Skip to content

Open-source AI browser agent for Chrome and Firefox (monorepo) 🧠

Ask on WebBrain's own card before sending to a different recipient

Claude6595f4e6c427
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 122f1202c..ae41c7d44 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -27,7 +27,7 @@ This changelog was generated from the repository Git history and release tags. V
- Ordinary controls (filter chips, folder links, menus, tabs, toggles, draft attachment and media removal, composer tools) work before and after a correction; X and Bluesky no longer reject them as unidentified publication actions. After a correction, identical resubmissions are reported as already done, a corrected in-place save or a requested post on another platform is allowed once the earlier result is known, and requests to remove characters or hashtags are no longer treated as deleting the post. A submit-probe exception that left real publish controls unresolved is fixed.
- A correction sent while a run is working is no longer lost when the extension background restarts before the run uses it. The resumed run applies it first, once, in the order it was sent; if the run does not resume, the correction returns to the queue marked as paused, as after Stop. Clearing the conversation or closing the tab discards it.
- Buttons that animate when the pointer reaches them (a hover lift, scale or border transition) are no longer refused once before working: the click waits up to 0.6 seconds, without sending anything, until the button stops moving, then presses it once at its new centre. A button that keeps moving, is covered or replaced, or any input or Stop during that wait still cancels the click. Hover, drag and drop, and checkbox actions refused before any input are reported as not sent.
-- Confirming a message recipient now works the first time. When the open conversation's name differs from the name in your request ("gamze" and "Gamze Çömlekçi"), picking that exact name in the confirmation approves it, however the question is worded, including a question asked before the first send; Firefox now shows the same confirmation question as Chrome. A reply that refuses or corrects ("No, not Gamze Çömlekçi", "Cancel all") is never taken as approval, and a reply that does not pick the name ("that's the right person") approves nothing and is explained instead of being treated as consent. Attachment and emoji buttons next to a chat box (Instagram's "Add Photo or Video") are no longer treated as Send buttons.
+- Sending a message to someone whose name differs from your request (you asked for "gamze", the open chat is "Gamze Çömlekçi") no longer ends in "Send blocked by safety guard". WebBrain asks you once on its own card, "Send to Gamze Çömlekçi?" with Send and Don't send, and sends only after you click Send; Don't send stops that send for the rest of the task. The card shows the person the open conversation actually has, reads the same in every language, and does not depend on how the model words a question. If the model asks first and you pick that exact name, the card is skipped. A reply that refuses or corrects ("No, not Gamze Çömlekçi", "Cancel all") is never taken as approval; before, both authorized the send. Firefox now behaves like Chrome. Attachment and emoji buttons next to a chat box (Instagram's "Add Photo or Video") are no longer treated as Send buttons.
## [40.3.0] - 2026-10-12
diff --git a/docs/page-feedback-monitor.md b/docs/page-feedback-monitor.md
index e77ba4ece..fd0f7fedd 100644
--- a/docs/page-feedback-monitor.md
+++ b/docs/page-feedback-monitor.md
@@ -296,18 +296,28 @@ Steer or grant authorization. Enter and Alt+Enter retain their existing behavior
another approval question cannot repair missing evidence. Recipient
clarifications report `recipientBinding` separately from general user
authorization and suppress repeated questions for known technical blockers.
-- A recipient clarification approves the recipients the page addresses when
- its question names each of them and asks about sending to them (or declares
- a recipient purpose), and the user's answer picks those exact names; the
- wording "instead" is not required. A question asked before any send was
- blocked binds to a fresh read-only observation of the open conversation, and
- the send itself is still checked against the page. A question that hides the
- recipient, a reply that does not name it, and a refusal or redirect ("No, not
- …", "Cancel all") approve nothing, and the clarify result tells the model why.
- Only an affirmative grant ("Send all remaining messages…", "send all")
- approves every remaining send. Icon-only attachment and picker launchers
- beside a chat composer, named by their icon's label or title, are composer
- utilities; Like, Send, mixed and unnamed icons stay guarded.
+- When a send would reach recipients other than the ones the task named, and
+ approval is the only thing missing (the plan authorizes sending, the body,
+ baseline and dispatch binding are present), WebBrain asks the user on its
+ own card: "Send to <recipients>?" with fixed choices (Send; on tasks with
+ several recipients also "Send, and don't ask again in this task"; Don't
+ send) and no free text. The card shows the recipients from the page probe
+ and the names the request used. Send approves those recipients for the rest
+ of the task and the guard runs again on a fresh observation before dispatch;
+ a conversation that changed meanwhile is not sent to. Don't send blocks
+ that send for the rest of the task without asking again. Stop cancels the
+ card. Unattended scheduled runs are not asked and send nothing. The model
+ is never told to obtain consent itself.
+- A model clarification still counts when its question names every observed
+ recipient and asks about sending to them (or declares a recipient purpose)
+ and the user's answer picks those exact names; a recipient question asked
+ before any send binds to a fresh read-only observation. Refusals and
+ redirects ("No, not …", "Cancel all") never approve, only an affirmative
+ grant ("Send all remaining messages…") approves every remaining send, and a
+ reply that names no recipient approves nothing; the model is told that
+ WebBrain will confirm the recipient itself. Icon-only attachment and picker
+ launchers beside a chat composer, named by their icon's label or title, are
+ composer utilities; Like, Send, mixed and unnamed icons stay guarded.
- A cancelled `beforeinput` handled by a native chat editor can receive an
exact read-only draft certificate while its original operation, document,
identity nodes, editor, focus and selection remain current. The certificate
diff --git a/package.json b/package.json
index 8adcd09ba..19a1c602a 100644
--- a/package.json
+++ b/package.json
@@ -59,9 +59,9 @@
"benchmark:relevance": "node scripts/benchmark-offline-relevance.mjs --verbose",
"test:social-contract": "node --test test/social-publish-contract.mjs test/publication-quote-markup.mjs",
"test:social-contract:dom": "node test/social-publish-contract-dom.mjs",
- "test:runtime-lifecycle": "node test/bot-memory-dom.mjs && node --test test/agent-lifecycle.mjs test/runtime-startup.mjs test/run-ui-scheduled-lifecycle.mjs test/transport-deadlines.mjs test/cdp-worker-restart.mjs test/bot-memory.mjs test/bot-memory-registries.mjs test/bot-memory-cloud-controller.mjs test/cdp-clear-receipt.mjs test/cdp-field-submit-recovery.mjs test/conversation-persistence.mjs test/context-live-tool-group.mjs test/integration-races.mjs test/watch-completion-checkpoint.mjs test/runtime-model-identity.mjs test/provider-message-privacy.mjs test/runtime-task-authority.mjs test/planner-repair-authority.mjs test/runtime-progress-continuation.mjs test/chat-resume-chain.mjs test/chat-resume-completion.mjs test/native-chat-execution-ledger.mjs test/chat-send-dispatch-result.mjs test/chat-reply-dedup-race.mjs test/memcode-lifecycle.mjs test/runtime-peer-review.mjs test/read-continuation-schema.mjs test/completion-submit-acknowledgement.mjs test/completion-live-status.mjs test/completion-iframe-submit.mjs test/completion-semantic-commit.mjs test/completion-diagnostics.mjs test/mastodon-publication.mjs test/calculator.mjs test/chat-recovery-protocol.mjs test/chat-pending-reconciliation.mjs test/semantic-page-retry.mjs test/pdf-detection.mjs test/runtime-lifecycle.mjs test/collection-read-progress.mjs test/network-lifecycle.mjs test/text-write-cancellation.mjs test/trusted-field-preparation.mjs test/draftjs-text.mjs test/rich-text-frameworks.mjs test/cdp-managed-text-selection.mjs test/firefox-rich-text-readback.mjs test/contenteditable-beforeinput.mjs test/trusted-field-preparation-ownership.mjs test/typing-preparation-geometry.mjs test/chat-steering.mjs test/lifecycle-steering-restart.mjs test/resource-mutation-guards.mjs test/completion-steering-receipt-authority.mjs test/steering-revision-recovery.mjs test/pending-clarification-hydration.mjs test/permission-steering-wakeup.mjs test/pure-calculation-reply.mjs test/pure-calculation-tools.mjs test/page-feedback.mjs test/page-feedback-progress.mjs test/ask-response-scope.mjs test/ask-completion-churn.mjs test/page-feedback-policy.mjs test/page-feedback-transport-races.mjs test/page-feedback-recovery.mjs test/telegram-read-preparation-agent.mjs test/media-download-agent-handler.mjs test/code-scanning-url-recipient.mjs test/apocalypse-comm-parsing.mjs test/apocalypse-scalar-decoding.mjs test/bitgpu-chat-security.mjs test/social-media-url-upgrades.mjs test/downloaded-file-saved-bytes.mjs test/downloaded-file-local-probe.mjs test/formless-verification-recovery.mjs test/file-upload-accept.mjs test/file-upload-accept-agent.mjs test/workflow-route-generic-completion.mjs test/release-publication-completion.mjs test/workflow-implicit-metadata.mjs test/completion-current-execution-evidence.mjs test/monitor-intervention-contract.mjs test/monitor-owned-geometry.mjs test/monitor-viewport-remainder.mjs test/monitor-local-attribution.mjs test/monitor-lifecycle-leaks.mjs test/feedback-automatic-churn.mjs test/feedback-navigation-idle.mjs test/feedback-run-boundaries.mjs test/feedback-ask-viewing.mjs test/lifecycle-terminal-done.mjs test/lifecycle-planner-digest.mjs test/lifecycle-vision-fallback.mjs test/guards-control-classification.mjs test/guards-unbound-deletion.mjs test/guards-steering-receipts.mjs && node test/ui-content-lifecycle.mjs && node --test test/native-telegram-chat.mjs test/native-telegram-recipient.mjs test/telegram-native-baseline.mjs test/telegram-native-latest.mjs test/native-chat-pre-enter-draft.mjs test/chat-draft-dispatch-ownership.mjs test/native-telegram-alias-preparation.mjs test/telegram-read-preparation-content.mjs test/queued-composer-ownership.mjs test/onboarding-provider-ready.mjs test/workflow-native-targets.mjs test/native-whatsapp-chat.mjs test/native-chat-context-identity.mjs test/native-whatsapp-contact.mjs test/whatsapp-native-bootstrap.mjs test/whatsapp-drawer-identity.mjs test/whatsapp-read-latest.mjs test/whatsapp-read-preparation.mjs test/whatsapp-chat-completion.mjs test/whatsapp-chat-restart.mjs test/chat-goal-lifecycle.mjs test/chat-completion.mjs test/chat-generic-dispatch.mjs test/completion-live-status-browser.mjs test/native-confirmation-visibility.mjs test/read-continuation-browser.mjs test/iframe-preparation-focus.mjs test/contenteditable-literal.mjs test/native-chat-empty-editor.mjs test/native-chat-trusted-clear.mjs test/chat-steering-ui.mjs test/assistant-message-visibility-ui.mjs test/page-monitor-ui.mjs test/page-monitor-dialog.mjs test/page-monitor-dialog-native.mjs test/page-monitor-inline-post.mjs test/bluesky-composer-context.mjs test/page-monitor-anchored.mjs test/page-monitor-upload-owner.mjs test/page-monitor-upload-release.mjs test/page-monitor-native-controls.mjs test/page-monitor-native-preparation.mjs test/native-preparation-cold.mjs test/page-monitor-navigation.mjs test/page-monitor-main-owner.mjs test/page-monitor-collateral-controls.mjs test/accessibility-tree-scoped-budget.mjs test/ax-reference-origin.mjs test/page-monitor-decorative-hit.mjs test/social-ui-navigation.mjs test/native-resource-deletion-binding.mjs test/dropdown-menu-inventory.mjs test/page-monitor-passive-progress.mjs test/media-download-binding.mjs test/media-download-capture-integration.mjs test/social-media-downloader-reinjection.mjs test/upload-file-local-state-guidance.mjs && node test/message-recipient-upload.mjs && node test/message-recipient-clarify-binding.mjs && node --test test/message-recipient-whatsapp.mjs && node test/quality/integration-mv3.mjs --full-form && node test/quality/literal-calculate-midrun-mv3.mjs && node test/quality/ask-completion-churn-mv3.mjs && node test/quality/telegram-cold-preparation-mv3.mjs && node test/quality/native-chat-mv3.mjs && node test/quality/native-chat-presubmit-mv3.mjs && node test/quality/cloud-bot-memory-mv3.mjs && node test/quality/whatsapp-contact-matrix.mjs && node test/quality/pdf-detection-mv3.mjs && node test/quality/download-upload-mv3.mjs && node test/quality/upload-release-binding-mv3.mjs && node test/quality/release-review-world-mv3.mjs && node test/quality/downloaded-file-saved-bytes-mv3.mjs && node test/quality/file-upload-accept-mv3.mjs && node test/quality/bulk-resume-mv3.mjs && node test/quality/literal-frame-mv3.mjs && node test/quality/mastodon-publication-mv3.mjs && node test/quality/mastodon-deletion-mv3.mjs && node test/quality/unbound-deletion-mv3.mjs && node test/quality/recipient-clarify-mv3.mjs && node test/quality/anchored-action-mv3.mjs && node test/quality/inline-social-composer-mv3.mjs && node test/quality/bluesky-composer-mv3.mjs && node test/quality/dropdown-menu-matrix.mjs && node test/quality/mastodon-deletion-navigation-mv3.mjs && node test/quality/semantic-navigation-matrix.mjs && node test/quality/workflow-replay-mv3.mjs && node test/quality/generative-media-mv3.mjs && node test/quality/cdp-worker-restart-mv3.mjs && node test/quality/steering-worker-restart-mv3.mjs",
+ "test:runtime-lifecycle": "node test/bot-memory-dom.mjs && node --test test/agent-lifecycle.mjs test/runtime-startup.mjs test/run-ui-scheduled-lifecycle.mjs test/transport-deadlines.mjs test/cdp-worker-restart.mjs test/bot-memory.mjs test/bot-memory-registries.mjs test/bot-memory-cloud-controller.mjs test/cdp-clear-receipt.mjs test/cdp-field-submit-recovery.mjs test/conversation-persistence.mjs test/context-live-tool-group.mjs test/integration-races.mjs test/watch-completion-checkpoint.mjs test/runtime-model-identity.mjs test/provider-message-privacy.mjs test/runtime-task-authority.mjs test/planner-repair-authority.mjs test/runtime-progress-continuation.mjs test/chat-resume-chain.mjs test/chat-resume-completion.mjs test/native-chat-execution-ledger.mjs test/chat-send-dispatch-result.mjs test/chat-reply-dedup-race.mjs test/memcode-lifecycle.mjs test/runtime-peer-review.mjs test/read-continuation-schema.mjs test/completion-submit-acknowledgement.mjs test/completion-live-status.mjs test/completion-iframe-submit.mjs test/completion-semantic-commit.mjs test/completion-diagnostics.mjs test/mastodon-publication.mjs test/calculator.mjs test/chat-recovery-protocol.mjs test/chat-pending-reconciliation.mjs test/semantic-page-retry.mjs test/pdf-detection.mjs test/runtime-lifecycle.mjs test/collection-read-progress.mjs test/network-lifecycle.mjs test/text-write-cancellation.mjs test/trusted-field-preparation.mjs test/draftjs-text.mjs test/rich-text-frameworks.mjs test/cdp-managed-text-selection.mjs test/firefox-rich-text-readback.mjs test/contenteditable-beforeinput.mjs test/trusted-field-preparation-ownership.mjs test/typing-preparation-geometry.mjs test/chat-steering.mjs test/lifecycle-steering-restart.mjs test/resource-mutation-guards.mjs test/completion-steering-receipt-authority.mjs test/steering-revision-recovery.mjs test/pending-clarification-hydration.mjs test/permission-steering-wakeup.mjs test/pure-calculation-reply.mjs test/pure-calculation-tools.mjs test/page-feedback.mjs test/page-feedback-progress.mjs test/ask-response-scope.mjs test/ask-completion-churn.mjs test/page-feedback-policy.mjs test/page-feedback-transport-races.mjs test/page-feedback-recovery.mjs test/telegram-read-preparation-agent.mjs test/media-download-agent-handler.mjs test/code-scanning-url-recipient.mjs test/apocalypse-comm-parsing.mjs test/apocalypse-scalar-decoding.mjs test/bitgpu-chat-security.mjs test/social-media-url-upgrades.mjs test/downloaded-file-saved-bytes.mjs test/downloaded-file-local-probe.mjs test/formless-verification-recovery.mjs test/file-upload-accept.mjs test/file-upload-accept-agent.mjs test/workflow-route-generic-completion.mjs test/release-publication-completion.mjs test/workflow-implicit-metadata.mjs test/completion-current-execution-evidence.mjs test/monitor-intervention-contract.mjs test/monitor-owned-geometry.mjs test/monitor-viewport-remainder.mjs test/monitor-local-attribution.mjs test/monitor-lifecycle-leaks.mjs test/feedback-automatic-churn.mjs test/feedback-navigation-idle.mjs test/feedback-run-boundaries.mjs test/feedback-ask-viewing.mjs test/lifecycle-terminal-done.mjs test/lifecycle-planner-digest.mjs test/lifecycle-vision-fallback.mjs test/guards-control-classification.mjs test/guards-unbound-deletion.mjs test/guards-steering-receipts.mjs && node test/ui-content-lifecycle.mjs && node --test test/native-telegram-chat.mjs test/native-telegram-recipient.mjs test/telegram-native-baseline.mjs test/telegram-native-latest.mjs test/native-chat-pre-enter-draft.mjs test/chat-draft-dispatch-ownership.mjs test/native-telegram-alias-preparation.mjs test/telegram-read-preparation-content.mjs test/queued-composer-ownership.mjs test/onboarding-provider-ready.mjs test/workflow-native-targets.mjs test/native-whatsapp-chat.mjs test/native-chat-context-identity.mjs test/native-whatsapp-contact.mjs test/whatsapp-native-bootstrap.mjs test/whatsapp-drawer-identity.mjs test/whatsapp-read-latest.mjs test/whatsapp-read-preparation.mjs test/whatsapp-chat-completion.mjs test/whatsapp-chat-restart.mjs test/chat-goal-lifecycle.mjs test/chat-completion.mjs test/chat-generic-dispatch.mjs test/completion-live-status-browser.mjs test/native-confirmation-visibility.mjs test/read-continuation-browser.mjs test/iframe-preparation-focus.mjs test/contenteditable-literal.mjs test/native-chat-empty-editor.mjs test/native-chat-trusted-clear.mjs test/chat-steering-ui.mjs test/recipient-confirmation-ui.mjs test/assistant-message-visibility-ui.mjs test/page-monitor-ui.mjs test/page-monitor-dialog.mjs test/page-monitor-dialog-native.mjs test/page-monitor-inline-post.mjs test/bluesky-composer-context.mjs test/page-monitor-anchored.mjs test/page-monitor-upload-owner.mjs test/page-monitor-upload-release.mjs test/page-monitor-native-controls.mjs test/page-monitor-native-preparation.mjs test/native-preparation-cold.mjs test/page-monitor-navigation.mjs test/page-monitor-main-owner.mjs test/page-monitor-collateral-controls.mjs test/accessibility-tree-scoped-budget.mjs test/ax-reference-origin.mjs test/page-monitor-decorative-hit.mjs test/social-ui-navigation.mjs test/native-resource-deletion-binding.mjs test/dropdown-menu-inventory.mjs test/page-monitor-passive-progress.mjs test/media-download-binding.mjs test/media-download-capture-integration.mjs test/social-media-downloader-reinjection.mjs test/upload-file-local-state-guidance.mjs && node test/message-recipient-upload.mjs && node test/message-recipient-clarify-binding.mjs && node --test test/message-recipient-whatsapp.mjs && node test/quality/integration-mv3.mjs --full-form && node test/quality/literal-calculate-midrun-mv3.mjs && node test/quality/ask-completion-churn-mv3.mjs && node test/quality/telegram-cold-preparation-mv3.mjs && node test/quality/native-chat-mv3.mjs && node test/quality/native-chat-presubmit-mv3.mjs && node test/quality/cloud-bot-memory-mv3.mjs && node test/quality/whatsapp-contact-matrix.mjs && node test/quality/pdf-detection-mv3.mjs && node test/quality/download-upload-mv3.mjs && node test/quality/upload-release-binding-mv3.mjs && node test/quality/release-review-world-mv3.mjs && node test/quality/downloaded-file-saved-bytes-mv3.mjs && node test/quality/file-upload-accept-mv3.mjs && node test/quality/bulk-resume-mv3.mjs && node test/quality/literal-frame-mv3.mjs && node test/quality/mastodon-publication-mv3.mjs && node test/quality/mastodon-deletion-mv3.mjs && node test/quality/unbound-deletion-mv3.mjs && node test/quality/recipient-clarify-mv3.mjs && node test/quality/anchored-action-mv3.mjs && node test/quality/inline-social-composer-mv3.mjs && node test/quality/bluesky-composer-mv3.mjs && node test/quality/dropdown-menu-matrix.mjs && node test/quality/mastodon-deletion-navigation-mv3.mjs && node test/quality/semantic-navigation-matrix.mjs && node test/quality/workflow-replay-mv3.mjs && node test/quality/generative-media-mv3.mjs && node test/quality/cdp-worker-restart-mv3.mjs && node test/quality/steering-worker-restart-mv3.mjs",
"test:page-feedback": "node --test test/trusted-field-preparation.mjs test/draftjs-text.mjs test/rich-text-frameworks.mjs test/cdp-managed-text-selection.mjs test/firefox-rich-text-readback.mjs test/contenteditable-beforeinput.mjs test/trusted-field-preparation-ownership.mjs test/typing-preparation-geometry.mjs test/pure-calculation-reply.mjs test/pure-calculation-tools.mjs test/page-feedback.mjs test/page-feedback-progress.mjs test/ask-response-scope.mjs test/ask-completion-churn.mjs test/page-feedback-policy.mjs test/page-feedback-transport-races.mjs test/page-feedback-recovery.mjs test/telegram-read-preparation-agent.mjs test/media-download-agent-handler.mjs test/page-monitor-ui.mjs test/page-monitor-dialog.mjs test/page-monitor-dialog-native.mjs test/page-monitor-inline-post.mjs test/bluesky-composer-context.mjs test/page-monitor-anchored.mjs test/page-monitor-upload-owner.mjs test/page-monitor-upload-release.mjs test/page-monitor-native-controls.mjs test/page-monitor-passive-progress.mjs test/media-download-binding.mjs test/media-download-capture-integration.mjs test/monitor-intervention-contract.mjs test/monitor-owned-geometry.mjs test/monitor-viewport-remainder.mjs test/monitor-local-attribution.mjs test/monitor-lifecycle-leaks.mjs test/feedback-automatic-churn.mjs test/feedback-navigation-idle.mjs test/feedback-run-boundaries.mjs test/feedback-ask-viewing.mjs test/delivery-click-ax-response-loss.mjs test/delivery-stop-compound.mjs test/delivery-cdp-input.mjs test/delivery-click-locks.mjs test/delivery-native-button-geometry.mjs test/delivery-hover-transition.mjs test/delivery-dispatch-boundary.mjs && node test/message-recipient-upload.mjs && node test/message-recipient-clarify-binding.mjs && node --test test/message-recipient-whatsapp.mjs",
- "test:chat-steering": "node --test test/chat-steering.mjs test/chat-steering-ui.mjs test/lifecycle-steering-latency.mjs test/lifecycle-steering-restart.mjs test/lifecycle-run-ui.mjs test/lifecycle-menu-prompts-held.mjs",
+ "test:chat-steering": "node --test test/chat-steering.mjs test/chat-steering-ui.mjs test/recipient-confirmation-ui.mjs test/lifecycle-steering-latency.mjs test/lifecycle-steering-restart.mjs test/lifecycle-run-ui.mjs test/lifecycle-menu-prompts-held.mjs",
"test:rich-text-dom": "node test/ui-content-lifecycle.mjs --dom",
"test:firefox-bidi": "node --test test/firefox-bidi.mjs test/firefox-full-page-screenshot.mjs",
"test:firefox-bidi:e2e": "node test/firefox-bidi-e2e.mjs",
@@ -92,7 +92,7 @@
"test:upload-owner": "node --test test/page-monitor-upload-owner.mjs test/page-monitor-upload-release.mjs",
"test:shard:quick": "npm run test:cms && npm run test:markdown && npm run test:generative-media && npm run test:systemone && npm run test:systemone:fast && node --test test/browser-dialogs.mjs test/capsolver-cloud-broker.mjs test/captcha-providers.mjs test/captcha-weighted-fallback.mjs test/captcha-hcaptcha-providers.mjs test/captcha-native-providers.mjs test/captcha-runtime-policy.mjs test/captcha-callback-bridge.mjs test/captcha-bridge-registration.mjs test/captcha-aws-recovery.mjs test/captcha-documented-contracts.mjs test/huggingface-signup-recovery.mjs test/trace-full-export.mjs test/feedback-traces.mjs && npm run test:firefox-bidi && npm run test:billing-notice && npm run test:compass-quota && npm run test:provider-limits && npm run test:provider-catalog && npm run test:provider-instances:ui && npm run test:openrouter-capabilities && npm run test:anthropic && npm run test:accessibility-tree-benchmark && npm run test:toolbar-guard && npm run test:cloud-bridge-approval && npm run test:discord && npm run test:pdf-read && npm run test:pdf-selection && npm run test:social-contract && npm run test:safesocial && npm run test:build-unpacked && npm run test:attachment-drop && npm run test:workflow-editor && node --test test/profile-sync-stats.mjs && node --test test/memcode-recall.mjs",
"test:shard:runtime-unit": "node --test test/agent-lifecycle.mjs test/runtime-startup.mjs test/run-ui-scheduled-lifecycle.mjs test/transport-deadlines.mjs test/cdp-worker-restart.mjs test/bot-memory.mjs test/bot-memory-click-guard.mjs test/bot-memory-registries.mjs test/bot-memory-cloud-controller.mjs test/cdp-clear-receipt.mjs test/cdp-field-submit-recovery.mjs test/conversation-persistence.mjs test/context-live-tool-group.mjs test/integration-races.mjs test/watch-completion-checkpoint.mjs test/runtime-model-identity.mjs test/provider-message-privacy.mjs test/runtime-task-authority.mjs test/planner-repair-authority.mjs test/runtime-progress-continuation.mjs test/chat-resume-chain.mjs test/chat-resume-completion.mjs test/native-chat-execution-ledger.mjs test/chat-send-dispatch-result.mjs test/chat-reply-dedup-race.mjs test/memcode-lifecycle.mjs test/runtime-peer-review.mjs test/read-continuation-schema.mjs test/completion-submit-acknowledgement.mjs test/completion-live-status.mjs test/completion-iframe-submit.mjs test/completion-semantic-commit.mjs test/completion-diagnostics.mjs test/mastodon-publication.mjs test/calculator.mjs test/chat-recovery-protocol.mjs test/chat-pending-reconciliation.mjs test/semantic-page-retry.mjs test/pdf-detection.mjs test/runtime-lifecycle.mjs test/collection-read-progress.mjs test/network-lifecycle.mjs test/text-write-cancellation.mjs test/trusted-field-preparation.mjs test/draftjs-text.mjs test/rich-text-frameworks.mjs test/cdp-managed-text-selection.mjs test/firefox-rich-text-readback.mjs test/contenteditable-beforeinput.mjs test/trusted-field-preparation-ownership.mjs test/typing-preparation-geometry.mjs test/chat-steering.mjs test/resource-mutation-guards.mjs test/completion-steering-receipt-authority.mjs test/steering-revision-recovery.mjs test/pending-clarification-hydration.mjs test/permission-steering-wakeup.mjs test/pure-calculation-reply.mjs test/pure-calculation-tools.mjs test/page-feedback.mjs test/page-feedback-progress.mjs test/ask-response-scope.mjs test/ask-completion-churn.mjs test/page-feedback-policy.mjs test/page-feedback-transport-races.mjs test/page-feedback-recovery.mjs test/telegram-read-preparation-agent.mjs test/media-download-agent-handler.mjs test/code-scanning-url-recipient.mjs test/apocalypse-comm-parsing.mjs test/apocalypse-scalar-decoding.mjs test/bitgpu-chat-security.mjs test/social-media-url-upgrades.mjs test/downloaded-file-saved-bytes.mjs test/downloaded-file-local-probe.mjs test/formless-verification-recovery.mjs test/file-upload-accept.mjs test/file-upload-accept-agent.mjs test/workflow-route-generic-completion.mjs test/release-publication-completion.mjs test/workflow-implicit-metadata.mjs test/completion-current-execution-evidence.mjs test/video-upload-attachment.mjs test/feedback-automatic-churn.mjs test/feedback-navigation-idle.mjs test/feedback-run-boundaries.mjs test/feedback-ask-viewing.mjs test/lifecycle-terminal-done.mjs test/lifecycle-planner-digest.mjs test/lifecycle-steering-latency.mjs test/lifecycle-steering-restart.mjs test/lifecycle-vision-fallback.mjs test/delivery-click-locks.mjs test/guards-steering-receipts.mjs test/terminal-user-messages.mjs",
- "test:shard:browser-a": "node test/bot-memory-dom.mjs && node test/bot-memory-click-dom.mjs && node test/ui-content-lifecycle.mjs && node --test test/native-telegram-chat.mjs test/native-telegram-recipient.mjs test/telegram-native-baseline.mjs test/telegram-native-latest.mjs test/native-chat-pre-enter-draft.mjs test/chat-draft-dispatch-ownership.mjs test/native-telegram-alias-preparation.mjs test/telegram-read-preparation-content.mjs test/queued-composer-ownership.mjs test/onboarding-provider-ready.mjs test/workflow-native-targets.mjs test/native-whatsapp-chat.mjs test/native-chat-context-identity.mjs test/native-whatsapp-contact.mjs test/whatsapp-native-bootstrap.mjs test/whatsapp-drawer-identity.mjs test/whatsapp-read-latest.mjs test/whatsapp-read-preparation.mjs test/whatsapp-chat-completion.mjs test/whatsapp-chat-restart.mjs test/chat-goal-lifecycle.mjs test/chat-completion.mjs test/chat-generic-dispatch.mjs test/completion-live-status-browser.mjs test/native-confirmation-visibility.mjs test/native-button-preparation.mjs test/read-continuation-browser.mjs test/iframe-preparation-focus.mjs test/contenteditable-literal.mjs test/native-chat-empty-editor.mjs test/native-chat-trusted-clear.mjs test/chat-steering-ui.mjs test/assistant-message-visibility-ui.mjs test/page-monitor-ui.mjs test/page-monitor-dialog.mjs test/page-monitor-dialog-native.mjs test/page-monitor-inline-post.mjs test/bluesky-composer-context.mjs test/page-monitor-anchored.mjs test/page-monitor-upload-owner.mjs test/page-monitor-upload-release.mjs test/page-monitor-native-controls.mjs test/page-monitor-native-preparation.mjs test/native-preparation-cold.mjs test/page-monitor-navigation.mjs test/page-monitor-main-owner.mjs test/page-monitor-collateral-controls.mjs test/accessibility-tree-scoped-budget.mjs test/ax-reference-origin.mjs test/page-monitor-decorative-hit.mjs test/social-ui-navigation.mjs test/native-resource-deletion-binding.mjs test/dropdown-menu-inventory.mjs test/page-monitor-passive-progress.mjs test/media-download-binding.mjs test/media-download-capture-integration.mjs test/social-media-downloader-reinjection.mjs test/upload-file-local-state-guidance.mjs test/monitor-intervention-contract.mjs test/monitor-owned-geometry.mjs test/monitor-viewport-remainder.mjs test/monitor-local-attribution.mjs test/monitor-lifecycle-leaks.mjs test/lifecycle-run-ui.mjs test/lifecycle-menu-prompts-held.mjs test/delivery-cdp-input.mjs test/delivery-click-ax-response-loss.mjs test/delivery-native-button-geometry.mjs test/delivery-hover-transition.mjs test/delivery-dispatch-boundary.mjs test/delivery-stop-compound.mjs test/guards-control-classification.mjs test/guards-unbound-deletion.mjs",
+ "test:shard:browser-a": "node test/bot-memory-dom.mjs && node test/bot-memory-click-dom.mjs && node test/ui-content-lifecycle.mjs && node --test test/native-telegram-chat.mjs test/native-telegram-recipient.mjs test/telegram-native-baseline.mjs test/telegram-native-latest.mjs test/native-chat-pre-enter-draft.mjs test/chat-draft-dispatch-ownership.mjs test/native-telegram-alias-preparation.mjs test/telegram-read-preparation-content.mjs test/queued-composer-ownership.mjs test/onboarding-provider-ready.mjs test/workflow-native-targets.mjs test/native-whatsapp-chat.mjs test/native-chat-context-identity.mjs test/native-whatsapp-contact.mjs test/whatsapp-native-bootstrap.mjs test/whatsapp-drawer-identity.mjs test/whatsapp-read-latest.mjs test/whatsapp-read-preparation.mjs test/whatsapp-chat-completion.mjs test/whatsapp-chat-restart.mjs test/chat-goal-lifecycle.mjs test/chat-completion.mjs test/chat-generic-dispatch.mjs test/completion-live-status-browser.mjs test/native-confirmation-visibility.mjs test/native-button-preparation.mjs test/read-continuation-browser.mjs test/iframe-preparation-focus.mjs test/contenteditable-literal.mjs test/native-chat-empty-editor.mjs test/native-chat-trusted-clear.mjs test/chat-steering-ui.mjs test/recipient-confirmation-ui.mjs test/assistant-message-visibility-ui.mjs test/page-monitor-ui.mjs test/page-monitor-dialog.mjs test/page-monitor-dialog-native.mjs test/page-monitor-inline-post.mjs test/bluesky-composer-context.mjs test/page-monitor-anchored.mjs test/page-monitor-upload-owner.mjs test/page-monitor-upload-release.mjs test/page-monitor-native-controls.mjs test/page-monitor-native-preparation.mjs test/native-preparation-cold.mjs test/page-monitor-navigation.mjs test/page-monitor-main-owner.mjs test/page-monitor-collateral-controls.mjs test/accessibility-tree-scoped-budget.mjs test/ax-reference-origin.mjs test/page-monitor-decorative-hit.mjs test/social-ui-navigation.mjs test/native-resource-deletion-binding.mjs test/dropdown-menu-inventory.mjs test/page-monitor-passive-progress.mjs test/media-download-binding.mjs test/media-download-capture-integration.mjs test/social-media-downloader-reinjection.mjs test/upload-file-local-state-guidance.mjs test/monitor-intervention-contract.mjs test/monitor-owned-geometry.mjs test/monitor-viewport-remainder.mjs test/monitor-local-attribution.mjs test/monitor-lifecycle-leaks.mjs test/lifecycle-run-ui.mjs test/lifecycle-menu-prompts-held.mjs test/delivery-cdp-input.mjs test/delivery-click-ax-response-loss.mjs test/delivery-native-button-geometry.mjs test/delivery-hover-transition.mjs test/delivery-dispatch-boundary.mjs test/delivery-stop-compound.mjs test/guards-control-classification.mjs test/guards-unbound-deletion.mjs",
"test:shard:browser-b1": "node test/message-recipient-upload.mjs && node test/message-recipient-clarify-binding.mjs && node --test test/message-recipient-whatsapp.mjs && node test/quality/integration-mv3.mjs --full-form && node test/quality/literal-calculate-midrun-mv3.mjs && node test/quality/ask-completion-churn-mv3.mjs && node test/quality/telegram-cold-preparation-mv3.mjs && node test/quality/native-chat-mv3.mjs && node test/quality/native-chat-presubmit-mv3.mjs && node test/quality/cloud-bot-memory-mv3.mjs",
"test:shard:browser-b2": "node test/quality/whatsapp-contact-matrix.mjs && node test/quality/pdf-detection-mv3.mjs && node test/quality/download-upload-mv3.mjs && node test/quality/upload-release-binding-mv3.mjs && node test/quality/release-review-world-mv3.mjs && node test/quality/downloaded-file-saved-bytes-mv3.mjs && node test/quality/file-upload-accept-mv3.mjs && node test/quality/bulk-resume-mv3.mjs && node test/quality/shared-action-guards-mv3.mjs && node test/quality/video-upload-attachment-mv3.mjs",
"test:shard:browser-c": "node test/quality/literal-frame-mv3.mjs && node test/quality/mastodon-publication-mv3.mjs && node test/quality/mastodon-deletion-mv3.mjs && node test/quality/unbound-deletion-mv3.mjs && node test/quality/recipient-clarify-mv3.mjs && node test/quality/anchored-action-mv3.mjs && node test/quality/inline-social-composer-mv3.mjs && node test/quality/bluesky-composer-mv3.mjs && node test/quality/dropdown-menu-matrix.mjs && node test/quality/mastodon-deletion-navigation-mv3.mjs && node test/quality/semantic-navigation-matrix.mjs && node test/quality/workflow-replay-mv3.mjs && node test/quality/generative-media-mv3.mjs && node test/quality/cdp-worker-restart-mv3.mjs && node test/quality/steering-worker-restart-mv3.mjs",
diff --git a/src/chrome/src/agent/agent.js b/src/chrome/src/agent/agent.js
index 72aabdb3c..3e14c2d03 100644
--- a/src/chrome/src/agent/agent.js
+++ b/src/chrome/src/agent/agent.js
@@ -8061,6 +8061,13 @@ export class Agent extends LoopDetector {
display.submitConfirmation.changedFields = Array.isArray(data.submitConfirmation.changedFields)
? data.submitConfirmation.changedFields.slice(0, 8).map(value => record(value, ['label', 'value'], 120)) : [];
}
+ if (data.recipientConfirmation) {
+ display.recipientConfirmation = record(data.recipientConfirmation, ['host', 'offerAll'], 300);
+ display.recipientConfirmation.recipients = Array.isArray(data.recipientConfirmation.recipients)
+ ? data.recipientConfirmation.recipients.slice(0, 16).map(value => record(value, ['identity', 'role'], 240)) : [];
+ display.recipientConfirmation.requested = Array.isArray(data.recipientConfirmation.requested)
+ ? data.recipientConfirmation.requested.slice(0, 8).map(value => String(value).slice(0, 240)) : [];
+ }
if (data.researchEscalation) display.researchEscalation = record(data.researchEscalation, ['engine', 'request'], 6000);
if (data.workflowHealing) {
const target = value => record(value, ['role', 'name', 'label', 'ariaLabel', 'placeholder',
@@ -15776,18 +15783,27 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
? { _completionNavigationReceipt: {} } : {}) };
let messageRecipientBlock = null;
if (!protectedPageFailure) {
+ const runMessageRecipientGuard = () => this._withContentActionDeadline(
+ async abortSignal => {
+ const block = await this._messageRecipientGuardBlock(
+ tabId, fnName, fnArgs, beforeUrl, messageRecipientExecutionContext,
+ );
+ this._throwIfAborted(abortSignal);
+ return block;
+ },
+ fnName,
+ this._contentActionDeadlineMs(fnName, fnArgs),
+ );
+ let askedRecipient = false;
try {
- messageRecipientBlock = await this._withContentActionDeadline(
- async abortSignal => {
- const block = await this._messageRecipientGuardBlock(
- tabId, fnName, fnArgs, beforeUrl, messageRecipientExecutionContext,
- );
- this._throwIfAborted(abortSignal);
- return block;
- },
- fnName,
- this._contentActionDeadlineMs(fnName, fnArgs),
- );
+ messageRecipientBlock = await runMessageRecipientGuard();
+ if (messageRecipientBlock?.recipientConfirmation && !scheduledBypassesGate) {
+ // The user confirms the recipient on WebBrain's own card; the
+ // card's wait has no content deadline, each guard run has one.
+ askedRecipient = true;
+ messageRecipientBlock = await this._resolveMessageRecipientConfirmation(tabId, messageRecipientBlock,
+ onUpdate, runMessageRecipientGuard);
+ }
} catch (error) {
if (error?.code !== 'content_action_timeout') throw error;
const loopStop = await recordPagePreparationTimeout(error, 'message-recipient safety preflight');
@@ -15795,6 +15811,19 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
if (interruptFailedBrowserAction(toolIndex, fnName)) { navNotices.length = 0; break; }
continue;
}
+ if (askedRecipient) {
+ if (this._checkAbort(tabId) || messageRecipientBlock?.recipientConfirmationCancelled === true) {
+ const value = '[Stopped by user before executing requested tool calls.]';
+ this._appendSyntheticToolResults(tabId, toolCalls, toolIndex, messages, onUpdate, step, () => ({
+ success: false,
+ cancelled: true,
+ error: value,
+ }));
+ onUpdate('warning', { message: 'Stopped by user.' });
+ return { action: 'abort', value };
+ }
+ if (this._hasPendingSteering(tabId)) return skipSteeredPermissionWait(toolIndex);
+ }
}
if (messageRecipientBlock) {
onUpdate('tool_call', { name: fnName, args: fnArgs, outcomeUnknown: false });
@@ -27783,13 +27812,18 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
if (recoverDraft) sendContext.nativeChatDraftBinding = draft.binding;
let recipientBlock = null;
try {
- recipientBlock = await this._messageRecipientGuardBlock(
+ const runRecipientGuard = () => this._messageRecipientGuardBlock(
tabId,
'set_field',
dispatchArgs,
before.url || '',
sendContext,
);
+ recipientBlock = await runRecipientGuard();
+ if (recipientBlock?.recipientConfirmation) {
+ recipientBlock = await this._resolveMessageRecipientConfirmation(tabId, recipientBlock, onUpdate, runRecipientGuard,
+ { allowPrompt: this.scheduledRunPolicies.get(tabId)?.requireConsequentialConfirmation !== false });
+ }
} catch (error) {
recipientBlock = {
success: false,
@@ -28017,7 +28051,7 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
guard?.approvedRecipients || [], guard?.messagingConversationScope || '']);
}
- async _recipientBoundUploadContext(tabId, args, executionContext = {}) {
+ async _recipientBoundUploadContext(tabId, args, executionContext = {}, onUpdate = null) {
let pageUrl = '';
try { pageUrl = await this._currentUrl(tabId); } catch {}
const publicComposer = executionContext.messageRecipientGuardRequired !== true
@@ -28040,7 +28074,12 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
error: 'Attachment blocked because its verified file source changed before dispatch.' } };
}
if (!context.messageRecipientDispatchBinding?.token) {
- const block = await this._messageRecipientGuardBlock(tabId, 'upload_file', args, pageUrl, context);
+ const runGuard = () => this._messageRecipientGuardBlock(tabId, 'upload_file', args, pageUrl, context);
+ let block = await runGuard();
+ if (block?.recipientConfirmation) {
+ block = await this._resolveMessageRecipientConfirmation(tabId, block, onUpdate, runGuard,
+ { allowPrompt: this.scheduledRunPolicies.get(tabId)?.requireConsequentialConfirmation !== false });
+ }
if (block) return { protected: true, block };
}
if (!context.messageRecipientDispatchBinding?.token || !sourceKey) {
@@ -28443,10 +28482,10 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
this._messageRecipientCandidates(probe),
);
// The user's OWN grant authorizes the send even when the planner's
- // original target differs — that is the entire point of asking. A bound
- // recipient clarification approves one address for the rest of the task,
- // and an explicit "send all remaining emails" answer approves the task.
- // Both only exist as the result of a real clarify answer, never model text.
+ // original target differs. A confirmed recipient (WebBrain's confirmation
+ // card, or a clarify answer that picks the observed name) is approved for
+ // the rest of the task, and "send all remaining" approves the task. Both
+ // come only from the user, never from model text.
const observedIdentities = this._messageRecipientCandidates(probe)
.map(item => normalizeRecipientIdentity(item?.identity || item))
.filter(Boolean);
@@ -28470,9 +28509,18 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
'Message send blocked because WebBrain cannot establish the active recipient identity from this page. Re-read the active conversation header or open the intended chat. If identity remains unavailable, report this technical blocker; additional recipient approval cannot resolve missing page evidence.');
}
if (conclusiveSend && observedIdentities.length > 0 && guard) delete guard.messageRecipientTechnicalBlock;
+ // A send that reaches someone other than the authorized recipient is
+ // confirmed by the user on WebBrain's own card (see
+ // _resolveMessageRecipientConfirmation), never by the model's wording.
+ // The plan must already authorize sending a message.
+ const recipientNeedsConfirmation = conclusiveSend && !!target && observedIdentities.length > 0
+ && !targetMatchesObserved && !approvedByUser && !!guard
+ && guard.requiresSubmission === true && guard.requiresStateChange === true
+ && !!normalizeMessageTarget(guard.messaging);
// An already authorized recipient can still lack draft or delivery
- // evidence. Asking to authorize that recipient again cannot repair it.
- if (conclusiveSend && (targetMatchesObserved || approvedByUser)) {
+ // evidence. Asking to authorize that recipient again cannot repair it,
+ // and neither can asking to confirm a new one.
+ if (conclusiveSend && (targetMatchesObserved || approvedByUser || recipientNeedsConfirmation)) {
if (name !== 'upload_file' && !this._workflowMessageBody(probe?.messageBody)) {
return technicalBlock('message_body_unverified',
'Message send blocked because WebBrain could not verify the draft body for the authorized recipient. Re-read the current composer and verify the intended draft. If the body remains unavailable, report this technical blocker instead of asking for recipient approval again.');
@@ -28498,6 +28546,23 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
'Message send blocked because WebBrain could not bind recipient verification to the final action dispatch. Re-read the active conversation and retry once. If binding remains unavailable, report this technical blocker instead of asking for recipient approval again.');
}
if (resolvedTwitterTarget) guard.messaging = resolvedTwitterTarget;
+ // The user approved this recipient even though the planner's original
+ // target did not match, so re-point the guard at what the user agreed
+ // to. Later sends in the same task then verify against the approval
+ // list instead of re-asking for the same address. This happens before
+ // an upload's authorization key is taken, so the key it is checked
+ // against at dispatch is the same.
+ if (!targetMatchesObserved && approvedByUser && observedIdentities.length > 0
+ && executionContext && typeof executionContext === 'object') {
+ const approvedTarget = normalizeMessageTarget({
+ target_kind: 'named',
+ recipients: this._messageRecipientCandidates(probe).map(item => ({
+ identity: item?.identity || item,
+ role: item?.role || 'to',
+ })),
+ });
+ if (approvedTarget && guard) guard.messaging = approvedTarget;
+ }
if (executionContext && typeof executionContext === 'object') {
executionContext.messageRecipientGuardRequired = true;
executionContext.messageRecipientDispatchBinding = binding;
@@ -28516,20 +28581,6 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
executionContext.messageRecipientTwitterEmptyConversationBaseline = true;
}
}
- // The user approved this recipient even though the planner's original
- // target did not match, so re-point the guard at what the user agreed
- // to. Later sends in the same task then verify against the approval
- // list instead of re-asking for the same address.
- if (!targetMatchesObserved && approvedByUser && observedIdentities.length > 0) {
- const approvedTarget = normalizeMessageTarget({
- target_kind: 'named',
- recipients: this._messageRecipientCandidates(probe).map(item => ({
- identity: item?.identity || item,
- role: item?.role || 'to',
- })),
- });
- if (approvedTarget && guard) guard.messaging = approvedTarget;
- }
if (probe.composerSubjectAvailable === true) {
executionContext.messageRecipientSubject = this._workflowMetadataValue(probe.composerSubject);
executionContext.messageRecipientSubjectAvailable = true;
@@ -28542,9 +28593,9 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
}
// Retain what the page actually showed only when the plan already permits
- // messaging and has pre-existing messaging authorization. The block below
- // tells the model to ask the user who the message is for, and that answer
- // has to be matched against real observed identities. A read-only plan
+ // messaging and has pre-existing messaging authorization. A clarify answer
+ // can then approve the recipient too, and it has to be matched against
+ // real observed identities. A read-only plan
// (requiresSubmission=false or requiresStateChange=false) or an unrelated
// consequential submission plan (guard.messaging=null) must never stage
// recipient consent: an answer to a recipient clarify must not elevate an
@@ -28571,14 +28622,49 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
: false;
}
+ const sendVerifiableOnceApproved = recipientNeedsConfirmation
+ && (name === 'upload_file' ? probe.messageAttachment === true && !!uploadSourceKey
+ : !!this._workflowMessageBody(probe?.messageBody))
+ && Number.isInteger(messageBodyBaselineCount) && messageBodyBaselineCount >= 0;
+ if (sendVerifiableOnceApproved) {
+ const recipients = this._messageRecipientCandidates(probe)
+ .map(item => ({ identity: String(item?.identity || item || '').trim().slice(0, 240),
+ role: ['to', 'cc', 'bcc'].includes(item?.role) ? item.role : 'to' }))
+ .filter(item => item.identity)
+ .slice(0, 16);
+ const declined = Array.isArray(guard.declinedRecipients) ? guard.declinedRecipients : [];
+ if (recipients.length && recipients.every(item => declined.includes(normalizeRecipientIdentity(item.identity)))) {
+ return this._declinedRecipientBlock(recipients);
+ }
+ const requestedTarget = normalizeMessageTarget(guard.requestedMessaging) || target;
+ let host = '';
+ try { host = new URL(resolvedPageUrl).hostname; } catch {}
+ return {
+ success: false,
+ blocked: true,
+ noDispatch: true,
+ dispatched: false,
+ messageRecipientGuard: true,
+ retryable: false,
+ reasonCode: 'active_recipient_unverified',
+ recipientConfirmation: {
+ recipients,
+ requested: requestedTarget?.target_kind === 'named'
+ ? requestedTarget.recipients.map(item => item.identity).slice(0, 8) : [],
+ host: host.slice(0, 300),
+ // "Don't ask again" only where a task sends to several people.
+ offerAll: (requestedTarget?.target_kind === 'named' && requestedTarget.recipients.length > 1)
+ || (Array.isArray(guard.approvedRecipients) && guard.approvedRecipients.length > 0),
+ },
+ error: this._recipientMismatchGuidance(recipients.map(item => item.identity).join(', '), requestedTarget),
+ };
+ }
+
const missingLinkedInComposer = policy.adapterName === 'linkedin'
&& probe?.success === true && probe?.composerAvailable === false;
const inconclusive = probe?.success !== true || probe?.conclusive !== true || probe?.messageSend !== true;
// Human-readable view of who the page actually addresses, so a mismatch
- // block can name the exact observed recipient instead of asking the user to
- // re-confirm blindly (which looped forever when the user had already
- // confirmed twice: the task authorization, not the chat answer, is what
- // the guard compares against).
+ // block can name the exact observed recipient.
const observedRecipientLabel = (() => {
try {
return (this._messageRecipientCandidates(probe) || [])
@@ -28615,23 +28701,132 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
}
/**
- * Model guidance for a send whose page-observed recipient is not the one
- * the task authorized. It names both, prescribes one clarify that shows the
- * exact observed name, and never suggests retrying without the user's pick:
- * the guard only accepts a bound answer, so a bare retry is blocked again.
+ * What the model reads when a send to an unconfirmed recipient could not be
+ * put to the user (an unattended run) or was not confirmed. It names both
+ * recipients and never asks the model to obtain consent itself: WebBrain
+ * shows the user its own confirmation whenever someone can answer it.
*/
_recipientMismatchGuidance(observedRecipientLabel, target) {
const planned = normalizeMessageTarget(target)?.target_kind === 'named'
? normalizeMessageTarget(target).recipients.map(recipient => recipient.identity).slice(0, 3).join(', ')
: '';
- const name = observedRecipientLabel || '<observed address>';
- return `Message send blocked: this send would go to ${observedRecipientLabel ? `"${observedRecipientLabel}"` : 'a recipient'}, which is not ${planned ? `exactly the recipient named for this task ("${planned}")` : 'the conversation authorized for this task'}, so nothing was dispatched. Do not retry with different targeting.
-Ask the user once whether to send it there. Put that exact name in the question and as an option, because authorization binds to what the page shows and a bare "yes" cannot authorize a send:
-clarify({ question: "Send it to ${name} instead?", options: ["${name}", "Cancel"] })
-If the task sends more than one message, also offer "Send all remaining messages in this task without asking again".
-- If they pick the name: that recipient is authorized for the rest of this task, so retry the send and continue normally.
-- If they pick "Send all remaining messages": every remaining send in this task is authorized, so keep going without asking again.
-- If they pick "Cancel": stop and report that the send was not authorized.`;
+ return `Message send blocked: this send would go to ${observedRecipientLabel ? `"${observedRecipientLabel}"` : 'a recipient'}, which is not ${planned ? `exactly the recipient named for this task ("${planned}")` : 'the conversation authorized for this task'}, and the user has not confirmed it, so nothing was sent. Do not retry with different targeting. Report that the message was not sent and name both recipients, or open the conversation the user asked for.`;
+ }
+
+ _declinedRecipientBlock(recipients = []) {
+ const label = recipients.map(item => item?.identity || item).filter(Boolean).slice(0, 3).join(', ');
+ return {
+ success: false,
+ blocked: true,
+ noDispatch: true,
+ dispatched: false,
+ messageRecipientGuard: true,
+ retryable: false,
+ recipientDeclined: true,
+ reasonCode: 'recipient_declined',
+ error: `The user chose not to send to ${label ? `"${label}"` : 'this recipient'}, so nothing was sent. Do not retry this send. If the user named someone else, open that conversation; otherwise report that the message was not sent.`,
+ };
+ }
+
+ /**
+ * Ask the user, on WebBrain's own card, whether a send may go to the
+ * recipients the page shows. Fixed choices return stable values, so there
+ * is no wording to interpret: 'once' approves these recipients for the rest
+ * of the task, 'always' every remaining send of the task (offered only for
+ * tasks with several recipients), anything else declines. Like permission
+ * prompts it never times out; Stop cancels it (null).
+ */
+ async _promptRecipientConfirmation(tabId, confirmation, onUpdate) {
+ const clarifyId = `recipient_${secureRandomBase36Token(12)}`;
+ const tabPending = this._pendingClarifications.get(tabId) || new Map();
+ this._pendingClarifications.set(tabId, tabPending);
+ const responsePromise = new Promise((resolve) => {
+ tabPending.set(clarifyId, { resolve, ts: Date.now() });
+ });
+ const recipients = (confirmation?.recipients || []).slice(0, 16);
+ const names = recipients.map(item => item.identity).join(', ');
+ try {
+ onUpdate('clarify', {
+ promptKind: 'recipientConfirmation',
+ clarifyId,
+ recipientConfirmation: {
+ recipients,
+ requested: (confirmation?.requested || []).slice(0, 8),
+ host: String(confirmation?.host || '').slice(0, 300),
+ offerAll: confirmation?.offerAll === true,
+ },
+ question: `Send to ${names}?`,
+ options: confirmation?.offerAll === true ? ['once', 'always', 'deny'] : ['once', 'deny'],
+ });
+ } catch { /* UI emit must never break the run */ }
+ const response = await responsePromise;
+ tabPending.delete(clarifyId);
+ if (tabPending.size === 0 && this._pendingClarifications.get(tabId) === tabPending) this._pendingClarifications.delete(tabId);
+ if (response?.cancelled) return null;
+ if (['timeout', 'auto'].includes(response?.source)) return 'deny';
+ const value = String(response?.answer || '').trim().toLowerCase();
+ if (value === 'once') return 'once';
+ if (value === 'always' && confirmation?.offerAll === true) return 'always';
+ return 'deny';
+ }
+
+ _approveConfirmedRecipients(tabId, confirmation, all = false) {
+ const guard = this._planExecutionGuards.get(tabId);
+ const target = normalizeMessageTarget({ target_kind: 'named', recipients: confirmation?.recipients || [] });
+ if (!guard || !target) return false;
+ if (!guard.requestedMessaging) guard.requestedMessaging = normalizeMessageTarget(guard.messaging);
+ guard.messaging = target;
+ const approved = Array.isArray(guard.approvedRecipients) ? guard.approvedRecipients.slice() : [];
+ for (const recipient of target.recipients) {
+ const identity = normalizeRecipientIdentity(recipient.identity);
+ if (identity && !approved.includes(identity)) approved.push(identity);
+ }
+ guard.approvedRecipients = approved;
+ if (all) guard.messageRecipientApprovedAll = true;
+ guard.pendingRecipientAuthorization = false;
+ guard.observedRecipientCandidates = null;
+ return true;
+ }
+
+ /**
+ * Resolve a guard result that only lacks the user's confirmation of the
+ * recipient: ask once on WebBrain's card, record the choice, and re-run the
+ * guard so the send binds to a fresh observation of the same page. Returns
+ * null when the send may proceed, otherwise the result for the model. An
+ * unattended run cannot be asked, so its block is returned unchanged.
+ */
+ async _resolveMessageRecipientConfirmation(tabId, block, onUpdate, rerunGuard, { allowPrompt = true } = {}) {
+ const confirmation = block?.recipientConfirmation;
+ if (!confirmation || !allowPrompt || typeof onUpdate !== 'function') return block;
+ const choice = await this._promptRecipientConfirmation(tabId, confirmation, onUpdate);
+ if (choice === null) {
+ return { success: false, cancelled: true, blocked: true, noDispatch: true, dispatched: false,
+ messageRecipientGuard: true, recipientConfirmationCancelled: true, reasonCode: 'recipient_confirmation_cancelled',
+ error: 'Stopped before the recipient was confirmed. Nothing was sent.' };
+ }
+ if (choice === 'deny') {
+ const guard = this._planExecutionGuards.get(tabId);
+ if (guard) {
+ const declined = Array.isArray(guard.declinedRecipients) ? guard.declinedRecipients.slice() : [];
+ for (const item of confirmation.recipients || []) {
+ const identity = normalizeRecipientIdentity(item?.identity);
+ if (identity && !declined.includes(identity)) declined.push(identity);
+ }
+ guard.declinedRecipients = declined;
+ }
+ return this._declinedRecipientBlock(confirmation.recipients);
+ }
+ if (!this._approveConfirmedRecipients(tabId, confirmation, choice === 'always')) {
+ return { ...block, recipientConfirmation: undefined };
+ }
+ const next = await rerunGuard();
+ if (next?.recipientConfirmation) {
+ const label = (next.recipientConfirmation.recipients || []).map(item => item.identity).join(', ');
+ const { recipientConfirmation, ...changed } = next;
+ return { ...changed, reasonCode: 'recipient_changed_during_confirmation',
+ error: `The open conversation changed to "${label}" while the user was confirming a different recipient, so nothing was sent. Re-read the page; if this is the conversation the user asked for, retry the send and WebBrain will ask the user again.` };
+ }
+ return next;
}
_isRecipientClarification(context, pendingType = 'message_recipient', observedCandidates = []) {
@@ -28807,9 +29002,10 @@ If the task sends more than one message, also offer "Send all remaining messages
/**
* What the model must do after a reply that did not approve the recipient
- * a blocked send would reach. Without this the generic "treat it as
- * authoritative" note reads as approval, the retry is blocked again and the
- * user is asked the same question until the run gives up.
+ * a send would reach. The generic "treat it as authoritative" note read as
+ * approval, so the model retried, was blocked again and asked the same
+ * question. WebBrain now confirms the recipient with the user itself when
+ * the send is tried, so the model never needs to ask again.
*/
_unboundRecipientClarificationNote(outcome = {}) {
const names = (Array.isArray(outcome?.observed) ? outcome.observed : [])
@@ -28818,18 +29014,15 @@ If the task sends more than one message, also offer "Send all remaining messages
.slice(0, 3);
const label = names.join(', ');
const named = label ? ` ("${label}")` : '';
- const example = label
- ? ` For example: clarify({ question: "Send it to ${label}?", options: ["${label}", "Cancel"] }).`
- : '';
+ const card = `If the user meant that recipient, continue with the send: WebBrain shows the user its own confirmation${named} before anything is sent. Do not ask about the recipient again.`;
switch (outcome?.reason) {
case 'answer_refused':
- return `The reply reads as declining or correcting the recipient this send would reach${named}, so nothing was authorized or sent. If the user named someone else, open that conversation and continue there. If it is unclear whether they meant that recipient, ask once more with the exact name as an option.${example} Otherwise stop and report that the send was not authorized.`;
+ return `The reply declines or corrects the recipient this send would reach${named}, so nothing was approved or sent. Do not send there. If the user named someone else, open that conversation and continue there; otherwise stop and report that the message was not sent.`;
case 'answer_does_not_name_recipient':
- return `The reply did not choose the recipient this send would reach${named}, so nothing was authorized or sent. Only an answer that picks that exact name approves it; a reply such as "yes" or "that's the right person" cannot. If the user meant that recipient, ask once more with the exact name in the question and as an option.${example} Otherwise stop and report that the send was not authorized.`;
case 'recipient_not_presented':
- return `The question did not ask the user to approve sending to the recipient this send would reach${named}, so the reply cannot approve it and nothing was sent. Ask once with that exact name in the question and as an option.${example}`;
+ return `The reply did not pick the recipient's exact name, so it approved nothing by itself and nothing was sent. ${card}`;
case 'no_pending_recipient':
- return 'This is a direct reply from the user; continue the task with it in mind. It did not approve a recipient by itself: approval is recorded only when the question shows the exact recipient name the open conversation has, so if a send is blocked, ask then with the exact name the block reports.';
+ return 'This is a direct reply from the user; continue the task with it in mind. If a send would reach someone other than the recipient named for the task, WebBrain asks the user itself; do not ask about the recipient again.';
default:
return '';
}
@@ -44643,7 +44836,7 @@ If the task sends more than one message, also offer "Send all remaining messages
if (!resolved.ok) return { success: false, error: resolved.error };
attachmentPayload = resolved;
}
- const recipientUpload = await this._recipientBoundUploadContext(tabId, args, dispatchContext);
+ const recipientUpload = await this._recipientBoundUploadContext(tabId, args, dispatchContext, onUpdate);
throwIfEarlyCdpAborted();
if (recipientUpload.block) return recipientUpload.block;
// Accept a downloadId as an alternative to filePath. After context
diff --git a/src/chrome/src/agent/message-recipient-guard.js b/src/chrome/src/agent/message-recipient-guard.js
index 02ed63881..a617e0f8c 100644
--- a/src/chrome/src/agent/message-recipient-guard.js
+++ b/src/chrome/src/agent/message-recipient-guard.js
@@ -226,21 +226,22 @@ export function answerNamesAllObservedRecipients(normalizedAnswer, observedCandi
// Stems match at a word start so inflected forms count; scripts written
// without spaces between words match anywhere.
const RECIPIENT_QUESTION_WORD = new RegExp(`(?<![\\p{L}\\p{N}])(?:${[
- 'send', 'sent', 'messag', 'deliver', 'forward', 'shar(?:e|ing)', 'repl(?:y|ies|ying)', 'recipient', 'contact',
+ 'send', 'sent', 'messag', 'deliver', 'forward', 'shar(?:e|ing)', 'repl(?:y|ies|ying)', 'recipient', 'receiv', 'contact',
'conversa', 'chat', 'dms?(?![\\p{L}])', 'e-?mail', 'mail', 'thread', 'inbox', 'person', 'people', 'user', 'account',
'whom', 'address',
- 'gönder', 'ilet', 'yolla', 'mesaj', 'paylaş', 'alıcı', 'kişi', 'kullanıcı', 'hesab', 'hesap', 'sohbet', 'konuşma',
- 'schick', 'nachricht', 'empfänger', 'weiterleit', 'teilen',
+ 'gönder', 'ilet', 'yolla', 'mesaj', 'paylaş', 'alıcı', 'kime', 'kişi', 'kullanıcı', 'hesab', 'hesap', 'sohbet', 'konuşma',
+ 'schick', 'nachricht', 'empfänger', 'erhalt', 'bekomm', 'wem', 'weiterleit', 'teilen',
'envi[aáeéoó]', 'envoy', 'envoi', 'mensaj', 'mensag', 'messagg', 'destinat', 'compart', 'partag', 'partilh',
- 'condivid', 'inoltr', 'reenv', 'transf[eé]r', 'invia', 'invio', 'pessoa', 'contatt',
+ 'condivid', 'inoltr', 'reenv', 'transf[eé]r', 'invia', 'invio', 'pessoa', 'contatt', 'recib', 'reçoi', 'recev',
+ 'receb', 'ricev',
'stuur', 'verstuur', 'verzend', 'bericht', 'ontvanger', 'delen',
'wyśl', 'wysł', 'wiadomo', 'odbiorc', 'udostępn', 'zpráv', 'příjemc',
- 'отправ', 'посла', 'пошл', 'сообщен', 'пересла', 'получател', 'собеседник', 'надісл', 'повідомл', 'одержувач',
+ 'отправ', 'посла', 'пошл', 'сообщен', 'пересла', 'получ', 'собеседник', 'надісл', 'повідомл', 'одержувач',
'kirim', 'pesan', 'penerima', 'bagikan', 'gửi', 'tin nhắn', 'người nhận', 'chia sẻ',
'أرسل', 'ارسل', 'إرسال', 'ارسال', 'رسالة', 'مستلم', 'المستلم', 'بفرست', 'پیام', 'گیرنده',
'שלח', 'הודעה', 'נמען', 'भेज', 'संदेश', 'प्राप्तकर्ता',
].join('|')})`, 'iu');
-const RECIPIENT_QUESTION_UNSPACED = /送|发|發|传|傳|消息|信息|訊息|收件|联系人|聯絡人|メッセージ|宛|보내|전송|메시지|받는|ส่ง|ข้อความ/u;
+const RECIPIENT_QUESTION_UNSPACED = /送|发|發|传|傳|消息|信息|訊息|收|联系人|聯絡人|メッセージ|宛|受け取|보내|전송|메시지|받|ส่ง|ข้อความ/u;
/**
* Does a clarification question show the user the exact recipients the page
diff --git a/src/chrome/src/agent/scheduler.js b/src/chrome/src/agent/scheduler.js
index 0ccf25e0a..d1e210582 100644
--- a/src/chrome/src/agent/scheduler.js
+++ b/src/chrome/src/agent/scheduler.js
@@ -144,6 +144,20 @@ function normalizePendingClarify(data, now = Date.now()) {
changedFields: normalizeFields(submitConfirmation.changedFields, 8),
};
}
+ const recipientConfirmation = asObject(obj.recipientConfirmation);
+ if (Array.isArray(recipientConfirmation.recipients) && recipientConfirmation.recipients.length) {
+ pending.recipientConfirmation = {
+ recipients: recipientConfirmation.recipients.slice(0, 16).map((recipient) => {
+ const item = asObject(recipient);
+ return { identity: String(item.identity || '').slice(0, 240), role: ['to', 'cc', 'bcc'].includes(item.role) ? item.role : 'to' };
+ }).filter((recipient) => recipient.identity),
+ requested: Array.isArray(recipientConfirmation.requested)
+ ? recipientConfirmation.requested.slice(0, 8).map((value) => String(value).slice(0, 240)).filter(Boolean)
+ : [],
+ host: String(recipientConfirmation.host || '').slice(0, 300),
+ offerAll: recipientConfirmation.offerAll === true,
+ };
+ }
return pending;
}
diff --git a/src/chrome/src/agent/tools.js b/src/chrome/src/agent/tools.js
index 0261875b5..2fd9fd0a6 100644
--- a/src/chrome/src/agent/tools.js
+++ b/src/chrome/src/agent/tools.js
@@ -906,7 +906,7 @@ export const AGENT_TOOLS = [
purpose: {
type: 'string',
enum: ['research_escalation', 'message_recipient', 'recipient_change'],
- description: 'Optional purpose of the clarification. Use message_recipient to ask the user to confirm or specify the message/email recipient, recipient_change to switch an already-authorized recipient, or research_escalation to delegate a read-only research subtask.',
+ description: 'Optional purpose of the clarification. Use message_recipient to ask the user who should receive a message, recipient_change to switch an already-authorized recipient, or research_escalation to delegate a read-only research subtask. Do not ask the user to confirm the recipient of a send that is already prepared: WebBrain confirms it with the user itself before sending.',
},
research_request: {
type: 'string',
diff --git a/src/chrome/src/ui/locales/ar.js b/src/chrome/src/ui/locales/ar.js
index 6880b0933..6f990f237 100644
--- a/src/chrome/src/ui/locales/ar.js
+++ b/src/chrome/src/ui/locales/ar.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "السماح مرة واحدة",
'sp.perm.always_allow': "السماح دائمًا على {host}",
'sp.perm.dont_allow': "عدم السماح",
+ "sp.recipient.question": "هل تريد الإرسال إلى {recipient}؟",
+ "sp.recipient.reason_requested": "ذكر طلبك «{requested}». المحادثة المفتوحة على {host} مع {recipient}.",
+ "sp.recipient.reason_open": "المحادثة المفتوحة على {host} مع {recipient}.",
+ "sp.recipient.send": "إرسال إلى {recipient}",
+ "sp.recipient.send_all": "إرسال وعدم السؤال مرة أخرى في هذه المهمة",
+ "sp.recipient.dont_send": "عدم الإرسال",
'st.tab.permissions': "الأذونات",
'st.perms.revoke': "إلغاء",
'st.perms.clear_all': "مسح كل الأذونات",
diff --git a/src/chrome/src/ui/locales/bn.js b/src/chrome/src/ui/locales/bn.js
index b36bd6a79..247fe19cd 100644
--- a/src/chrome/src/ui/locales/bn.js
+++ b/src/chrome/src/ui/locales/bn.js
@@ -386,6 +386,12 @@ export default {
'sp.perm.allow_once': "একবার অনুমতি দিন",
'sp.perm.always_allow': "সবসময় {host} এ অনুমতি দিন",
'sp.perm.dont_allow': "অনুমতি দেবেন না",
+ "sp.recipient.question": "{recipient}-কে পাঠাবেন?",
+ "sp.recipient.reason_requested": "আপনার অনুরোধে “{requested}” ছিল। {host}-এ খোলা কথোপকথনটি {recipient}-এর সাথে।",
+ "sp.recipient.reason_open": "{host}-এ খোলা কথোপকথনটি {recipient}-এর সাথে।",
+ "sp.recipient.send": "{recipient}-কে পাঠান",
+ "sp.recipient.send_all": "পাঠান, এবং এই কাজে আর জিজ্ঞাসা করবেন না",
+ "sp.recipient.dont_send": "পাঠাবেন না",
'sp.perm.skip_hint': "কম বাধা চান? \"সর্বদা অনুমতি দিন\" এই সাইটটি মনে রাখে। নীচের কমান্ড প্রতিটি সাইটে WebBrain অনুমতি অনুরোধ নিষ্ক্রিয় করে।",
'sp.perm.insert_skip_command': "/dangerously-skip-permissions ঢোকান",
'sp.perm.skip_hint_draft': "আপনার খসড়া অপরিবর্তিত. কমান্ড সন্নিবেশ করার আগে এটি সাফ করুন।",
diff --git a/src/chrome/src/ui/locales/de.js b/src/chrome/src/ui/locales/de.js
index ff8228a82..d8534684b 100644
--- a/src/chrome/src/ui/locales/de.js
+++ b/src/chrome/src/ui/locales/de.js
@@ -398,6 +398,12 @@ export default {
'sp.perm.allow_once': 'Einmal erlauben',
'sp.perm.always_allow': 'Immer erlauben auf {host}',
'sp.perm.dont_allow': 'Nicht erlauben',
+ "sp.recipient.question": "An {recipient} senden?",
+ "sp.recipient.reason_requested": "Deine Anfrage nannte „{requested}“. Die geöffnete Unterhaltung auf {host} ist mit {recipient}.",
+ "sp.recipient.reason_open": "Die geöffnete Unterhaltung auf {host} ist mit {recipient}.",
+ "sp.recipient.send": "An {recipient} senden",
+ "sp.recipient.send_all": "Senden und in dieser Aufgabe nicht mehr fragen",
+ "sp.recipient.dont_send": "Nicht senden",
'sp.perm.skip_hint': 'Weniger Unterbrechungen? „Immer erlauben" merkt sich diese Website. Der Befehl unten deaktiviert WebBrain-Berechtigungsabfragen auf allen Websites.',
'sp.perm.insert_skip_command': '/dangerously-skip-permissions einfügen',
'sp.perm.skip_hint_draft': 'Ihr Entwurf bleibt unverändert. Löschen Sie ihn, bevor Sie den Befehl einfügen.',
diff --git a/src/chrome/src/ui/locales/en.js b/src/chrome/src/ui/locales/en.js
index 8457c186e..7e5a4914f 100644
--- a/src/chrome/src/ui/locales/en.js
+++ b/src/chrome/src/ui/locales/en.js
@@ -391,6 +391,12 @@ export default {
'sp.perm.allow_once': 'Allow once',
'sp.perm.always_allow': 'Always allow on {host}',
'sp.perm.dont_allow': "Don't allow",
+ "sp.recipient.question": "Send to {recipient}?",
+ "sp.recipient.reason_requested": "Your request named “{requested}”. The open conversation on {host} is with {recipient}.",
+ "sp.recipient.reason_open": "The open conversation on {host} is with {recipient}.",
+ "sp.recipient.send": "Send to {recipient}",
+ "sp.recipient.send_all": "Send, and don’t ask again in this task",
+ "sp.recipient.dont_send": "Don’t send",
'sp.perm.skip_hint': 'Want fewer interruptions? “Always allow” remembers this site. The command below disables WebBrain permission prompts on every site.',
'sp.perm.insert_skip_command': 'Insert /dangerously-skip-permissions',
'sp.perm.skip_hint_draft': 'Your draft is unchanged. Clear it before inserting the command.',
diff --git a/src/chrome/src/ui/locales/es.js b/src/chrome/src/ui/locales/es.js
index be8044c44..0b2813cc8 100644
--- a/src/chrome/src/ui/locales/es.js
+++ b/src/chrome/src/ui/locales/es.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "Permitir una vez",
'sp.perm.always_allow': "Permitir siempre en {host}",
'sp.perm.dont_allow': "No permitir",
+ "sp.recipient.question": "¿Enviar a {recipient}?",
+ "sp.recipient.reason_requested": "Tu solicitud mencionaba «{requested}». La conversación abierta en {host} es con {recipient}.",
+ "sp.recipient.reason_open": "La conversación abierta en {host} es con {recipient}.",
+ "sp.recipient.send": "Enviar a {recipient}",
+ "sp.recipient.send_all": "Enviar y no volver a preguntar en esta tarea",
+ "sp.recipient.dont_send": "No enviar",
'st.tab.permissions': "Permisos",
'st.perms.revoke': "Revocar",
'st.perms.clear_all': "Borrar todos los permisos",
diff --git a/src/chrome/src/ui/locales/fa.js b/src/chrome/src/ui/locales/fa.js
index ad3a39161..a16bc29ab 100644
--- a/src/chrome/src/ui/locales/fa.js
+++ b/src/chrome/src/ui/locales/fa.js
@@ -386,6 +386,12 @@ export default {
'sp.perm.allow_once': "یکبار اجازه دهید",
'sp.perm.always_allow': "{host} همیشه مجاز باشد",
'sp.perm.dont_allow': "اجازه نده",
+ "sp.recipient.question": "به {recipient} ارسال شود؟",
+ "sp.recipient.reason_requested": "در درخواست شما «{requested}» آمده بود. گفتگوی باز در {host} با {recipient} است.",
+ "sp.recipient.reason_open": "گفتگوی باز در {host} با {recipient} است.",
+ "sp.recipient.send": "ارسال به {recipient}",
+ "sp.recipient.send_all": "ارسال کن و در این کار دیگر نپرس",
+ "sp.recipient.dont_send": "ارسال نکن",
'sp.perm.skip_hint': "وقفه های کمتری می خواهید؟ \"همیشه اجازه دهید\" این سایت را به خاطر می آورد. دستور زیر دستورات مجوز WebBrain را در هر سایت غیرفعال می کند.",
'sp.perm.insert_skip_command': "/dangerously-skip-permissions را درج کنید",
'sp.perm.skip_hint_draft': "پیش نویس شما بدون تغییر است. قبل از وارد کردن دستور آن را پاک کنید.",
diff --git a/src/chrome/src/ui/locales/fr.js b/src/chrome/src/ui/locales/fr.js
index f5652e934..ed62f1fb0 100644
--- a/src/chrome/src/ui/locales/fr.js
+++ b/src/chrome/src/ui/locales/fr.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "Autoriser une fois",
'sp.perm.always_allow': "Toujours autoriser sur {host}",
'sp.perm.dont_allow': "Ne pas autoriser",
+ "sp.recipient.question": "Envoyer à {recipient} ?",
+ "sp.recipient.reason_requested": "Votre demande mentionnait « {requested} ». La conversation ouverte sur {host} est avec {recipient}.",
+ "sp.recipient.reason_open": "La conversation ouverte sur {host} est avec {recipient}.",
+ "sp.recipient.send": "Envoyer à {recipient}",
+ "sp.recipient.send_all": "Envoyer sans redemander pendant cette tâche",
+ "sp.recipient.dont_send": "Ne pas envoyer",
'st.tab.permissions': "Autorisations",
'st.perms.revoke': "Révoquer",
'st.perms.clear_all': "Effacer toutes les autorisations",
diff --git a/src/chrome/src/ui/locales/he.js b/src/chrome/src/ui/locales/he.js
index bf9a67437..1a1257e66 100644
--- a/src/chrome/src/ui/locales/he.js
+++ b/src/chrome/src/ui/locales/he.js
@@ -377,6 +377,12 @@ export default {
"sp.perm.allow_once": "אפשר פעם אחת",
"sp.perm.always_allow": "אפשר תמיד {host}",
"sp.perm.dont_allow": "אל תאפשר",
+ "sp.recipient.question": "לשלוח אל {recipient}?",
+ "sp.recipient.reason_requested": "בבקשה שלך צוין \"{requested}\". השיחה הפתוחה ב-{host} היא עם {recipient}.",
+ "sp.recipient.reason_open": "השיחה הפתוחה ב-{host} היא עם {recipient}.",
+ "sp.recipient.send": "לשלוח אל {recipient}",
+ "sp.recipient.send_all": "לשלוח ולא לשאול שוב במשימה הזו",
+ "sp.recipient.dont_send": "לא לשלוח",
"sp.perm.verb.navigate": "לנווט אל",
"sp.perm.verb.click": "לחץ/שלח על",
"sp.perm.verb.type": "הקלד לתוך",
diff --git a/src/chrome/src/ui/locales/hi.js b/src/chrome/src/ui/locales/hi.js
index 8e1a99e31..cde29189d 100644
--- a/src/chrome/src/ui/locales/hi.js
+++ b/src/chrome/src/ui/locales/hi.js
@@ -386,6 +386,12 @@ export default {
'sp.perm.allow_once': "एक बार अनुमति दें",
'sp.perm.always_allow': "हमेशा {host} पर अनुमति दें",
'sp.perm.dont_allow': "अनुमति न दें",
+ "sp.recipient.question": "{recipient} को भेजें?",
+ "sp.recipient.reason_requested": "आपके अनुरोध में “{requested}” था। {host} पर खुली बातचीत {recipient} के साथ है।",
+ "sp.recipient.reason_open": "{host} पर खुली बातचीत {recipient} के साथ है।",
+ "sp.recipient.send": "{recipient} को भेजें",
+ "sp.recipient.send_all": "भेजें, और इस कार्य में दोबारा न पूछें",
+ "sp.recipient.dont_send": "न भेजें",
'sp.perm.skip_hint': "क्या आप कम रुकावटें चाहते हैं? \"हमेशा अनुमति दें\" यह साइट याद रखती है। नीचे दिया गया आदेश प्रत्येक साइट पर WebBrain अनुमति संकेतों को अक्षम कर देता है।",
'sp.perm.insert_skip_command': "/dangerously-skip-permissions डालें",
'sp.perm.skip_hint_draft': "आपका ड्राफ्ट अपरिवर्तित है. कमांड डालने से पहले इसे साफ़ करें।",
diff --git a/src/chrome/src/ui/locales/id.js b/src/chrome/src/ui/locales/id.js
index 6c3b262cb..beaa39dc8 100644
--- a/src/chrome/src/ui/locales/id.js
+++ b/src/chrome/src/ui/locales/id.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "Izinkan sekali",
'sp.perm.always_allow': "Selalu izinkan di {host}",
'sp.perm.dont_allow': "Jangan izinkan",
+ "sp.recipient.question": "Kirim ke {recipient}?",
+ "sp.recipient.reason_requested": "Permintaan Anda menyebut “{requested}”. Percakapan yang terbuka di {host} adalah dengan {recipient}.",
+ "sp.recipient.reason_open": "Percakapan yang terbuka di {host} adalah dengan {recipient}.",
+ "sp.recipient.send": "Kirim ke {recipient}",
+ "sp.recipient.send_all": "Kirim, dan jangan tanya lagi dalam tugas ini",
+ "sp.recipient.dont_send": "Jangan kirim",
'st.tab.permissions': "Izin",
'st.perms.revoke': "Cabut",
'st.perms.clear_all': "Hapus semua izin",
diff --git a/src/chrome/src/ui/locales/ja.js b/src/chrome/src/ui/locales/ja.js
index 832b5141d..63d4cf0d4 100644
--- a/src/chrome/src/ui/locales/ja.js
+++ b/src/chrome/src/ui/locales/ja.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "今回のみ許可",
'sp.perm.always_allow': "{host} で常に許可",
'sp.perm.dont_allow': "許可しない",
+ "sp.recipient.question": "{recipient} に送信しますか?",
+ "sp.recipient.reason_requested": "リクエストでは「{requested}」と指定されていました。{host} で開いている会話の相手は {recipient} です。",
+ "sp.recipient.reason_open": "{host} で開いている会話の相手は {recipient} です。",
+ "sp.recipient.send": "{recipient} に送信",
+ "sp.recipient.send_all": "送信し、このタスクでは今後確認しない",
+ "sp.recipient.dont_send": "送信しない",
'st.tab.permissions': "権限",
'st.perms.revoke': "取り消す",
'st.perms.clear_all': "すべての権限を消去",
diff --git a/src/chrome/src/ui/locales/ko.js b/src/chrome/src/ui/locales/ko.js
index 3e3cf1fc4..da072cf1e 100644
--- a/src/chrome/src/ui/locales/ko.js
+++ b/src/chrome/src/ui/locales/ko.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "한 번 허용",
'sp.perm.always_allow': "{host}에서 항상 허용",
'sp.perm.dont_allow': "허용 안 함",
+ "sp.recipient.question": "{recipient}에게 보낼까요?",
+ "sp.recipient.reason_requested": "요청에는 “{requested}”(이)라고 되어 있었습니다. {host}에서 열려 있는 대화 상대는 {recipient}입니다.",
+ "sp.recipient.reason_open": "{host}에서 열려 있는 대화 상대는 {recipient}입니다.",
+ "sp.recipient.send": "{recipient}에게 보내기",
+ "sp.recipient.send_all": "보내고 이 작업에서는 다시 묻지 않기",
+ "sp.recipient.dont_send": "보내지 않기",
'st.tab.permissions': "권한",
'st.perms.revoke': "취소",
'st.perms.clear_all': "모든 권한 지우기",
diff --git a/src/chrome/src/ui/locales/ms.js b/src/chrome/src/ui/locales/ms.js
index 8e155b3c4..4789b6cdd 100644
--- a/src/chrome/src/ui/locales/ms.js
+++ b/src/chrome/src/ui/locales/ms.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "Benarkan sekali",
'sp.perm.always_allow': "Sentiasa benarkan di {host}",
'sp.perm.dont_allow': "Jangan benarkan",
+ "sp.recipient.question": "Hantar kepada {recipient}?",
+ "sp.recipient.reason_requested": "Permintaan anda menyebut “{requested}”. Perbualan yang terbuka di {host} adalah dengan {recipient}.",
+ "sp.recipient.reason_open": "Perbualan yang terbuka di {host} adalah dengan {recipient}.",
+ "sp.recipient.send": "Hantar kepada {recipient}",
+ "sp.recipient.send_all": "Hantar, dan jangan tanya lagi dalam tugasan ini",
+ "sp.recipient.dont_send": "Jangan hantar",
'st.tab.permissions': "Kebenaran",
'st.perms.revoke': "Batalkan",
'st.perms.clear_all': "Kosongkan semua kebenaran",
diff --git a/src/chrome/src/ui/locales/nl.js b/src/chrome/src/ui/locales/nl.js
index 4439a0824..dc4f3f027 100644
--- a/src/chrome/src/ui/locales/nl.js
+++ b/src/chrome/src/ui/locales/nl.js
@@ -374,6 +374,12 @@ export default {
'sp.perm.allow_once': 'Eenmaal toestaan',
'sp.perm.always_allow': 'Altijd toestaan op {host}',
'sp.perm.dont_allow': 'Niet toestaan',
+ "sp.recipient.question": "Naar {recipient} sturen?",
+ "sp.recipient.reason_requested": "Je verzoek noemde ‘{requested}’. Het geopende gesprek op {host} is met {recipient}.",
+ "sp.recipient.reason_open": "Het geopende gesprek op {host} is met {recipient}.",
+ "sp.recipient.send": "Naar {recipient} sturen",
+ "sp.recipient.send_all": "Sturen en in deze taak niet meer vragen",
+ "sp.recipient.dont_send": "Niet sturen",
'sp.perm.skip_hint': 'Minder onderbrekingen? "Altijd toestaan" onthoudt deze site. Het onderstaande commando schakelt WebBrain-machtigingsvragen uit op elke site.',
'sp.perm.insert_skip_command': 'Voeg /dangerously-skip-permissions toe',
'sp.perm.skip_hint_draft': 'Uw concept is ongewijzigd. Wis het voordat u het commando toevoegt.',
diff --git a/src/chrome/src/ui/locales/pl.js b/src/chrome/src/ui/locales/pl.js
index 2f15a147d..2e28549b3 100644
--- a/src/chrome/src/ui/locales/pl.js
+++ b/src/chrome/src/ui/locales/pl.js
@@ -282,6 +282,12 @@ export default {
'sp.perm.allow_once': 'Zezwól raz',
'sp.perm.always_allow': 'Zawsze zezwalaj na {host}',
'sp.perm.dont_allow': 'Nie zezwalaj',
+ "sp.recipient.question": "Wysłać do {recipient}?",
+ "sp.recipient.reason_requested": "Twoja prośba wskazywała „{requested}”. Otwarta rozmowa w {host} jest z {recipient}.",
+ "sp.recipient.reason_open": "Otwarta rozmowa w {host} jest z {recipient}.",
+ "sp.recipient.send": "Wyślij do {recipient}",
+ "sp.recipient.send_all": "Wyślij i nie pytaj ponownie w tym zadaniu",
+ "sp.recipient.dont_send": "Nie wysyłaj",
'sp.perm.verb.navigate': 'przejść do',
'sp.perm.verb.click': 'kliknąć / wysłać na',
'sp.perm.verb.type': 'wpisać w',
diff --git a/src/chrome/src/ui/locales/pt.js b/src/chrome/src/ui/locales/pt.js
index 50760bac7..78dfa3866 100644
--- a/src/chrome/src/ui/locales/pt.js
+++ b/src/chrome/src/ui/locales/pt.js
@@ -386,6 +386,12 @@ export default {
'sp.perm.allow_once': "Permitir uma vez",
'sp.perm.always_allow': "Sempre permitir em {host}",
'sp.perm.dont_allow': "Não permita",
+ "sp.recipient.question": "Enviar para {recipient}?",
+ "sp.recipient.reason_requested": "Seu pedido mencionava “{requested}”. A conversa aberta em {host} é com {recipient}.",
+ "sp.recipient.reason_open": "A conversa aberta em {host} é com {recipient}.",
+ "sp.recipient.send": "Enviar para {recipient}",
+ "sp.recipient.send_all": "Enviar e não perguntar de novo nesta tarefa",
+ "sp.recipient.dont_send": "Não enviar",
'sp.perm.skip_hint': "Quer menos interrupções? “Sempre permitir” lembra este site. O comando abaixo desativa os prompts de permissão WebBrain em todos os sites.",
'sp.perm.insert_skip_command': "Insira /dangerously-skip-permissions",
'sp.perm.skip_hint_draft': "Seu rascunho permanece inalterado. Limpe-o antes de inserir o comando.",
diff --git a/src/chrome/src/ui/locales/ru.js b/src/chrome/src/ui/locales/ru.js
index 949754eff..29ea06a81 100644
--- a/src/chrome/src/ui/locales/ru.js
+++ b/src/chrome/src/ui/locales/ru.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "Разрешить один раз",
'sp.perm.always_allow': "Всегда разрешать на {host}",
'sp.perm.dont_allow': "Не разрешать",
+ "sp.recipient.question": "Отправить получателю {recipient}?",
+ "sp.recipient.reason_requested": "В запросе указано «{requested}». Открытый диалог на {host}: {recipient}.",
+ "sp.recipient.reason_open": "Открытый диалог на {host}: {recipient}.",
+ "sp.recipient.send": "Отправить получателю {recipient}",
+ "sp.recipient.send_all": "Отправить и больше не спрашивать в этой задаче",
+ "sp.recipient.dont_send": "Не отправлять",
'st.tab.permissions': "Разрешения",
'st.perms.revoke': "Отозвать",
'st.perms.clear_all': "Очистить все разрешения",
diff --git a/src/chrome/src/ui/locales/th.js b/src/chrome/src/ui/locales/th.js
index 04ef323c4..13c1ace5e 100644
--- a/src/chrome/src/ui/locales/th.js
+++ b/src/chrome/src/ui/locales/th.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "อนุญาตครั้งเดียว",
'sp.perm.always_allow': "อนุญาตเสมอบน {host}",
'sp.perm.dont_allow': "ไม่อนุญาต",
+ "sp.recipient.question": "ส่งถึง {recipient} ไหม?",
+ "sp.recipient.reason_requested": "คำขอของคุณระบุ “{requested}” บทสนทนาที่เปิดอยู่บน {host} คือกับ {recipient}",
+ "sp.recipient.reason_open": "บทสนทนาที่เปิดอยู่บน {host} คือกับ {recipient}",
+ "sp.recipient.send": "ส่งถึง {recipient}",
+ "sp.recipient.send_all": "ส่ง และไม่ต้องถามอีกในงานนี้",
+ "sp.recipient.dont_send": "ไม่ส่ง",
'st.tab.permissions': "สิทธิ์",
'st.perms.revoke': "เพิกถอน",
'st.perms.clear_all': "ล้างสิทธิ์ทั้งหมด",
diff --git a/src/chrome/src/ui/locales/tl.js b/src/chrome/src/ui/locales/tl.js
index a1ba1642e..9613dec8b 100644
--- a/src/chrome/src/ui/locales/tl.js
+++ b/src/chrome/src/ui/locales/tl.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "Payagan minsan",
'sp.perm.always_allow': "Palaging payagan sa {host}",
'sp.perm.dont_allow': "Huwag payagan",
+ "sp.recipient.question": "Ipadala kay {recipient}?",
+ "sp.recipient.reason_requested": "Binanggit ng iyong kahilingan ang “{requested}”. Ang bukas na usapan sa {host} ay kay {recipient}.",
+ "sp.recipient.reason_open": "Ang bukas na usapan sa {host} ay kay {recipient}.",
+ "sp.recipient.send": "Ipadala kay {recipient}",
+ "sp.recipient.send_all": "Ipadala, at huwag nang magtanong muli sa gawaing ito",
+ "sp.recipient.dont_send": "Huwag ipadala",
'st.tab.permissions': "Mga pahintulot",
'st.perms.revoke': "Bawiin",
'st.perms.clear_all': "I-clear ang lahat ng pahintulot",
diff --git a/src/chrome/src/ui/locales/tr.js b/src/chrome/src/ui/locales/tr.js
index 71cba1a00..b8c598ffe 100644
--- a/src/chrome/src/ui/locales/tr.js
+++ b/src/chrome/src/ui/locales/tr.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "Bir kez izin ver",
'sp.perm.always_allow': "{host} için her zaman izin ver",
'sp.perm.dont_allow': "İzin verme",
+ "sp.recipient.question": "{recipient} adlı kişiye gönderilsin mi?",
+ "sp.recipient.reason_requested": "İsteğinde “{requested}” yazıyordu. {host} üzerinde açık olan sohbet: {recipient}.",
+ "sp.recipient.reason_open": "{host} üzerinde açık olan sohbet: {recipient}.",
+ "sp.recipient.send": "{recipient} adlı kişiye gönder",
+ "sp.recipient.send_all": "Gönder, bu görevde bir daha sorma",
+ "sp.recipient.dont_send": "Gönderme",
'st.tab.permissions': "İzinler",
'st.tab.skills': 'Skills',
'st.perms.revoke': "Kaldır",
diff --git a/src/chrome/src/ui/locales/uk.js b/src/chrome/src/ui/locales/uk.js
index 2a1a35e16..3ce22c43c 100644
--- a/src/chrome/src/ui/locales/uk.js
+++ b/src/chrome/src/ui/locales/uk.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "Дозволити один раз",
'sp.perm.always_allow': "Завжди дозволяти на {host}",
'sp.perm.dont_allow': "Не дозволяти",
+ "sp.recipient.question": "Надіслати отримувачу {recipient}?",
+ "sp.recipient.reason_requested": "У запиті вказано «{requested}». Відкрита розмова на {host}: {recipient}.",
+ "sp.recipient.reason_open": "Відкрита розмова на {host}: {recipient}.",
+ "sp.recipient.send": "Надіслати отримувачу {recipient}",
+ "sp.recipient.send_all": "Надіслати й більше не питати в цьому завданні",
+ "sp.recipient.dont_send": "Не надсилати",
'st.tab.permissions': "Дозволи",
'st.perms.revoke': "Відкликати",
'st.perms.clear_all': "Очистити всі дозволи",
diff --git a/src/chrome/src/ui/locales/vi.js b/src/chrome/src/ui/locales/vi.js
index 0fe9e370e..649497050 100644
--- a/src/chrome/src/ui/locales/vi.js
+++ b/src/chrome/src/ui/locales/vi.js
@@ -386,6 +386,12 @@ export default {
'sp.perm.allow_once': "Cho phép một lần",
'sp.perm.always_allow': "Luôn cho phép trên {host}",
'sp.perm.dont_allow': "Không cho phép",
+ "sp.recipient.question": "Gửi cho {recipient}?",
+ "sp.recipient.reason_requested": "Yêu cầu của bạn ghi “{requested}”. Cuộc trò chuyện đang mở trên {host} là với {recipient}.",
+ "sp.recipient.reason_open": "Cuộc trò chuyện đang mở trên {host} là với {recipient}.",
+ "sp.recipient.send": "Gửi cho {recipient}",
+ "sp.recipient.send_all": "Gửi và không hỏi lại trong tác vụ này",
+ "sp.recipient.dont_send": "Không gửi",
'sp.perm.skip_hint': "Muốn ít bị gián đoạn hơn? “Luôn cho phép” ghi nhớ trang web này. Lệnh bên dưới vô hiệu hóa lời nhắc cấp phép WebBrain trên mọi trang web.",
'sp.perm.insert_skip_command': "Chèn /dangerously-skip-permissions",
'sp.perm.skip_hint_draft': "Bản nháp của bạn không thay đổi. Xóa nó trước khi chèn lệnh.",
diff --git a/src/chrome/src/ui/locales/zh.js b/src/chrome/src/ui/locales/zh.js
index 69ed2e127..52630b85e 100644
--- a/src/chrome/src/ui/locales/zh.js
+++ b/src/chrome/src/ui/locales/zh.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "允许一次",
'sp.perm.always_allow': "始终允许 {host}",
'sp.perm.dont_allow': "不允许",
+ "sp.recipient.question": "发送给 {recipient}?",
+ "sp.recipient.reason_requested": "你的请求中写的是“{requested}”。{host} 上打开的对话对象是 {recipient}。",
+ "sp.recipient.reason_open": "{host} 上打开的对话对象是 {recipient}。",
+ "sp.recipient.send": "发送给 {recipient}",
+ "sp.recipient.send_all": "发送,并在此任务中不再询问",
+ "sp.recipient.dont_send": "不发送",
'st.tab.permissions': "权限",
'st.perms.revoke': "撤销",
'st.perms.clear_all': "清除所有权限",
diff --git a/src/chrome/src/ui/sidepanel.js b/src/chrome/src/ui/sidepanel.js
index ca60a8461..bc9c21221 100644
--- a/src/chrome/src/ui/sidepanel.js
+++ b/src/chrome/src/ui/sidepanel.js
@@ -6288,7 +6288,8 @@ function rebindClarifyCards() {
// Restart countdown after HTML restore when timeout metadata survived on
// the card. Skip permission/form-submit cards (they never auto-timeout).
- if (card.dataset.permission === '1' || card.dataset.submitConfirmation === '1') return;
+ if (card.dataset.permission === '1' || card.dataset.submitConfirmation === '1'
+ || card.dataset.recipientConfirmation === '1') return;
const deadlineTs = Number(card.dataset.deadlineTs);
if (!Number.isFinite(deadlineTs) || deadlineTs <= 0) return;
const firstOption = card.dataset.firstOption
@@ -11150,7 +11151,7 @@ function renderClarifyCard(data) {
if (data.pendingReconciliation === true) card.dataset.pendingReconciliation = '1';
card.dataset.memorySource = scheduledJobId
? 'scheduled_clarification'
- : data.workflowHealing || data.pendingReconciliation === true
+ : data.workflowHealing || data.pendingReconciliation === true || data.recipientConfirmation
? ''
: data.submitConfirmation
? 'form_confirmation'
@@ -11267,6 +11268,54 @@ function renderClarifyCard(data) {
return;
}
+ // Recipient confirmation: WebBrain asks whether a message may go to the
+ // person the open conversation shows. Fixed choices return stable values
+ // ('once'/'always'/'deny') with no free-text input, so nothing is parsed.
+ if (data.recipientConfirmation) {
+ card.dataset.recipientConfirmation = '1';
+ const confirmation = data.recipientConfirmation || {};
+ const recipients = (Array.isArray(confirmation.recipients) ? confirmation.recipients : [])
+ .map(item => ({ identity: String(item?.identity || '').slice(0, 240), role: String(item?.role || 'to').toLowerCase() }))
+ .filter(item => item.identity)
+ .slice(0, 16);
+ const recipient = recipients
+ .map(item => (item.role === 'cc' || item.role === 'bcc' ? `${item.identity} (${item.role.toUpperCase()})` : item.identity))
+ .join(', ') || String(data.question || '').slice(0, 240);
+ const requested = (Array.isArray(confirmation.requested) ? confirmation.requested : [])
+ .map(value => String(value || '').slice(0, 240)).filter(Boolean).join(', ');
+ const host = String(confirmation.host || '').slice(0, 300) || 'this site';
+ qEl.textContent = t('sp.recipient.question', { recipient });
+ const reasonEl = document.createElement('div');
+ reasonEl.className = 'clarify-reason';
+ reasonEl.textContent = requested
+ ? t('sp.recipient.reason_requested', { requested, recipient, host })
+ : t('sp.recipient.reason_open', { recipient, host });
+ card.appendChild(reasonEl);
+ const optionsEl = document.createElement('div');
+ optionsEl.className = 'clarify-options';
+ const choices = [
+ ['once', t('sp.recipient.send', { recipient })],
+ ...(confirmation.offerAll === true ? [['always', t('sp.recipient.send_all')]] : []),
+ ['deny', t('sp.recipient.dont_send')],
+ ];
+ for (const [value, label] of choices) {
+ const b = document.createElement('button');
+ b.type = 'button';
+ b.className = 'clarify-option';
+ b.textContent = String(label).slice(0, 300);
+ b.dataset.value = value;
+ b.addEventListener('click', () => {
+ card.dataset.answerLabel = b.textContent;
+ submitClarify(card, tabId, clarifyId, value, 'option');
+ });
+ optionsEl.appendChild(b);
+ }
+ card.appendChild(optionsEl);
+ content.appendChild(card);
+ scrollToBottom({ force: true });
+ return;
+ }
+
// Permission-prompt mode: localized question + fixed choices that
// return a stable VALUE ('once'/'always'/'deny'), and NO free-text input —
// so there's nothing to parse and no English/locale dependency.
@@ -11524,7 +11573,8 @@ function lockClarifyCardFromAuto(data) {
for (const card of document.querySelectorAll('.clarify-card')) {
if (String(card.dataset.clarifyId || '') !== clarifyId) continue;
if (card.classList.contains('clarify-answered')) return;
- if (card.dataset.permission === '1' || card.dataset.submitConfirmation === '1') return;
+ if (card.dataset.permission === '1' || card.dataset.submitConfirmation === '1'
+ || card.dataset.recipientConfirmation === '1') return;
clearClarifyCountdown(card);
card.classList.add('clarify-answered');
for (const el of card.querySelectorAll('button, input')) {
@@ -11764,7 +11814,7 @@ function submitClarify(card, tabId, clarifyId, answer, source) {
} else {
prefix = typeof t === 'function' ? t('sp.clarify.your_answer') : 'Your answer:';
}
- answered.textContent = `${prefix} ${answer}`;
+ answered.textContent = `${prefix} ${card.dataset.answerLabel || answer}`;
card.appendChild(answered);
placeAnsweredClarifyCardInTimeline(card);
scrollToBottom();
diff --git a/src/firefox/src/agent/agent.js b/src/firefox/src/agent/agent.js
index f5db36096..6ef3494b9 100644
--- a/src/firefox/src/agent/agent.js
+++ b/src/firefox/src/agent/agent.js
@@ -7734,6 +7734,13 @@ export class Agent extends LoopDetector {
display.submitConfirmation.changedFields = Array.isArray(data.submitConfirmation.changedFields)
? data.submitConfirmation.changedFields.slice(0, 8).map(value => record(value, ['label', 'value'], 120)) : [];
}
+ if (data.recipientConfirmation) {
+ display.recipientConfirmation = record(data.recipientConfirmation, ['host', 'offerAll'], 300);
+ display.recipientConfirmation.recipients = Array.isArray(data.recipientConfirmation.recipients)
+ ? data.recipientConfirmation.recipients.slice(0, 16).map(value => record(value, ['identity', 'role'], 240)) : [];
+ display.recipientConfirmation.requested = Array.isArray(data.recipientConfirmation.requested)
+ ? data.recipientConfirmation.requested.slice(0, 8).map(value => String(value).slice(0, 240)) : [];
+ }
if (data.researchEscalation) display.researchEscalation = record(data.researchEscalation, ['engine', 'request'], 6000);
if (data.workflowHealing) {
const target = value => record(value, ['role', 'name', 'label', 'ariaLabel', 'placeholder',
@@ -14346,18 +14353,27 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
...(fnName === 'navigate' && this._completionSubmitStates.get(tabId)?.semanticCommit
? { _completionNavigationReceipt: {} } : {}) };
let messageRecipientBlock = null;
+ const runMessageRecipientGuard = () => this._withContentActionDeadline(
+ async abortSignal => {
+ const block = await this._messageRecipientGuardBlock(
+ tabId, fnName, fnArgs, beforeUrl, messageRecipientExecutionContext,
+ );
+ this._throwIfAborted(abortSignal);
+ return block;
+ },
+ fnName,
+ this._contentActionDeadlineMs(fnName, fnArgs),
+ );
+ let askedRecipient = false;
try {
- messageRecipientBlock = await this._withContentActionDeadline(
- async abortSignal => {
- const block = await this._messageRecipientGuardBlock(
- tabId, fnName, fnArgs, beforeUrl, messageRecipientExecutionContext,
- );
- this._throwIfAborted(abortSignal);
- return block;
- },
- fnName,
- this._contentActionDeadlineMs(fnName, fnArgs),
- );
+ messageRecipientBlock = await runMessageRecipientGuard();
+ if (messageRecipientBlock?.recipientConfirmation && !scheduledBypassesGate) {
+ // The user confirms the recipient on WebBrain's own card; the
+ // card's wait has no content deadline, each guard run has one.
+ askedRecipient = true;
+ messageRecipientBlock = await this._resolveMessageRecipientConfirmation(tabId, messageRecipientBlock,
+ onUpdate, runMessageRecipientGuard);
+ }
} catch (error) {
if (error?.code !== 'content_action_timeout') throw error;
const loopStop = await recordPagePreparationTimeout(error, 'message-recipient safety preflight');
@@ -14365,6 +14381,19 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
if (interruptFailedBrowserAction(toolIndex, fnName)) { navNotices.length = 0; break; }
continue;
}
+ if (askedRecipient) {
+ if (this._checkAbort(tabId) || messageRecipientBlock?.recipientConfirmationCancelled === true) {
+ const value = '[Stopped by user before executing requested tool calls.]';
+ this._appendSyntheticToolResults(tabId, toolCalls, toolIndex, messages, onUpdate, step, () => ({
+ success: false,
+ cancelled: true,
+ error: value,
+ }));
+ onUpdate('warning', { message: 'Stopped by user.' });
+ return { action: 'abort', value };
+ }
+ if (this._hasPendingSteering(tabId)) return skipSteeredPermissionWait(toolIndex);
+ }
if (messageRecipientBlock) {
onUpdate('tool_call', { name: fnName, args: fnArgs, outcomeUnknown: false });
onUpdate('tool_result', { name: fnName, result: messageRecipientBlock });
@@ -25217,13 +25246,18 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
if (recoverDraft) sendContext.nativeChatDraftBinding = draft.binding;
let recipientBlock = null;
try {
- recipientBlock = await this._messageRecipientGuardBlock(
+ const runRecipientGuard = () => this._messageRecipientGuardBlock(
tabId,
'set_field',
dispatchArgs,
before.url || '',
sendContext,
);
+ recipientBlock = await runRecipientGuard();
+ if (recipientBlock?.recipientConfirmation) {
+ recipientBlock = await this._resolveMessageRecipientConfirmation(tabId, recipientBlock, onUpdate, runRecipientGuard,
+ { allowPrompt: this.scheduledRunPolicies.get(tabId)?.requireConsequentialConfirmation !== false });
+ }
} catch (error) {
recipientBlock = {
success: false,
@@ -25451,7 +25485,7 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
guard?.approvedRecipients || [], guard?.messagingConversationScope || '']);
}
- async _recipientBoundUploadContext(tabId, args, executionContext = {}) {
+ async _recipientBoundUploadContext(tabId, args, executionContext = {}, onUpdate = null) {
let pageUrl = '';
try { pageUrl = await this._currentUrl(tabId); } catch {}
const publicComposer = executionContext.messageRecipientGuardRequired !== true
@@ -25474,7 +25508,12 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
error: 'Attachment blocked because its verified file source changed before dispatch.' } };
}
if (!context.messageRecipientDispatchBinding?.token) {
- const block = await this._messageRecipientGuardBlock(tabId, 'upload_file', args, pageUrl, context);
+ const runGuard = () => this._messageRecipientGuardBlock(tabId, 'upload_file', args, pageUrl, context);
+ let block = await runGuard();
+ if (block?.recipientConfirmation) {
+ block = await this._resolveMessageRecipientConfirmation(tabId, block, onUpdate, runGuard,
+ { allowPrompt: this.scheduledRunPolicies.get(tabId)?.requireConsequentialConfirmation !== false });
+ }
if (block) return { protected: true, block };
}
if (!context.messageRecipientDispatchBinding?.token || !sourceKey) {
@@ -25880,6 +25919,11 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
target,
this._messageRecipientCandidates(probe),
);
+ // The user's OWN grant authorizes the send even when the planner's
+ // original target differs. A confirmed recipient (WebBrain's confirmation
+ // card, or a clarify answer that picks the observed name) is approved for
+ // the rest of the task, and "send all remaining" approves the task. Both
+ // come only from the user, never from model text.
const observedIdentities = this._messageRecipientCandidates(probe)
.map(item => normalizeRecipientIdentity(item?.identity || item))
.filter(Boolean);
@@ -25903,9 +25947,18 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
'Message send blocked because WebBrain cannot establish the active recipient identity from this page. Re-read the active conversation header or open the intended chat. If identity remains unavailable, report this technical blocker; additional recipient approval cannot resolve missing page evidence.');
}
if (conclusiveSend && observedIdentities.length > 0 && guard) delete guard.messageRecipientTechnicalBlock;
+ // A send that reaches someone other than the authorized recipient is
+ // confirmed by the user on WebBrain's own card (see
+ // _resolveMessageRecipientConfirmation), never by the model's wording.
+ // The plan must already authorize sending a message.
+ const recipientNeedsConfirmation = conclusiveSend && !!target && observedIdentities.length > 0
+ && !targetMatchesObserved && !approvedByUser && !!guard
+ && guard.requiresSubmission === true && guard.requiresStateChange === true
+ && !!normalizeMessageTarget(guard.messaging);
// An already authorized recipient can still lack draft or delivery
- // evidence. Asking to authorize that recipient again cannot repair it.
- if (conclusiveSend && (targetMatchesObserved || approvedByUser)) {
+ // evidence. Asking to authorize that recipient again cannot repair it,
+ // and neither can asking to confirm a new one.
+ if (conclusiveSend && (targetMatchesObserved || approvedByUser || recipientNeedsConfirmation)) {
if (name !== 'upload_file' && !this._workflowMessageBody(probe?.messageBody)) {
return technicalBlock('message_body_unverified',
'Message send blocked because WebBrain could not verify the draft body for the authorized recipient. Re-read the current composer and verify the intended draft. If the body remains unavailable, report this technical blocker instead of asking for recipient approval again.');
@@ -25931,6 +25984,23 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
'Message send blocked because WebBrain could not bind recipient verification to the final action dispatch. Re-read the active conversation and retry once. If binding remains unavailable, report this technical blocker instead of asking for recipient approval again.');
}
if (resolvedTwitterTarget) guard.messaging = resolvedTwitterTarget;
+ // The user approved this recipient even though the planner's original
+ // target did not match, so re-point the guard at what the user agreed
+ // to. Later sends in the same task then verify against the approval
+ // list instead of re-asking for the same address. This happens before
+ // an upload's authorization key is taken, so the key it is checked
+ // against at dispatch is the same.
+ if (!targetMatchesObserved && approvedByUser && observedIdentities.length > 0
+ && executionContext && typeof executionContext === 'object') {
+ const approvedTarget = normalizeMessageTarget({
+ target_kind: 'named',
+ recipients: this._messageRecipientCandidates(probe).map(item => ({
+ identity: item?.identity || item,
+ role: item?.role || 'to',
+ })),
+ });
+ if (approvedTarget && guard) guard.messaging = approvedTarget;
+ }
if (executionContext && typeof executionContext === 'object') {
executionContext.messageRecipientGuardRequired = true;
executionContext.messageRecipientDispatchBinding = binding;
@@ -25950,16 +26020,6 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
executionContext.messageRecipientTwitterEmptyConversationBaseline = true;
}
}
- if (!targetMatchesObserved && approvedByUser && observedIdentities.length > 0) {
- const approvedTarget = normalizeMessageTarget({
- target_kind: 'named',
- recipients: this._messageRecipientCandidates(probe).map(item => ({
- identity: item?.identity || item,
- role: item?.role || 'to',
- })),
- });
- if (approvedTarget && guard) guard.messaging = approvedTarget;
- }
if (probe.composerSubjectAvailable === true) {
executionContext.messageRecipientSubject = this._workflowMetadataValue(probe.composerSubject);
executionContext.messageRecipientSubjectAvailable = true;
@@ -25972,9 +26032,9 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
}
// Retain what the page actually showed only when the plan already permits
- // messaging and has pre-existing messaging authorization. The block below
- // tells the model to ask the user who the message is for, and that answer
- // has to be matched against real observed identities. A read-only plan
+ // messaging and has pre-existing messaging authorization. A clarify answer
+ // can then approve the recipient too, and it has to be matched against
+ // real observed identities. A read-only plan
// (requiresSubmission=false or requiresStateChange=false) or an unrelated
// consequential submission plan (guard.messaging=null) must never stage
// recipient consent: an answer to a recipient clarify must not elevate an
@@ -26001,12 +26061,49 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
: false;
}
+ const sendVerifiableOnceApproved = recipientNeedsConfirmation
+ && (name === 'upload_file' ? probe.messageAttachment === true && !!uploadSourceKey
+ : !!this._workflowMessageBody(probe?.messageBody))
+ && Number.isInteger(messageBodyBaselineCount) && messageBodyBaselineCount >= 0;
+ if (sendVerifiableOnceApproved) {
+ const recipients = this._messageRecipientCandidates(probe)
+ .map(item => ({ identity: String(item?.identity || item || '').trim().slice(0, 240),
+ role: ['to', 'cc', 'bcc'].includes(item?.role) ? item.role : 'to' }))
+ .filter(item => item.identity)
+ .slice(0, 16);
+ const declined = Array.isArray(guard.declinedRecipients) ? guard.declinedRecipients : [];
+ if (recipients.length && recipients.every(item => declined.includes(normalizeRecipientIdentity(item.identity)))) {
+ return this._declinedRecipientBlock(recipients);
+ }
+ const requestedTarget = normalizeMessageTarget(guard.requestedMessaging) || target;
+ let host = '';
+ try { host = new URL(resolvedPageUrl).hostname; } catch {}
+ return {
+ success: false,
+ blocked: true,
+ noDispatch: true,
+ dispatched: false,
+ messageRecipientGuard: true,
+ retryable: false,
+ reasonCode: 'active_recipient_unverified',
+ recipientConfirmation: {
+ recipients,
+ requested: requestedTarget?.target_kind === 'named'
+ ? requestedTarget.recipients.map(item => item.identity).slice(0, 8) : [],
+ host: host.slice(0, 300),
+ // "Don't ask again" only where a task sends to several people.
+ offerAll: (requestedTarget?.target_kind === 'named' && requestedTarget.recipients.length > 1)
+ || (Array.isArray(guard.approvedRecipients) && guard.approvedRecipients.length > 0),
+ },
+ error: this._recipientMismatchGuidance(recipients.map(item => item.identity).join(', '), requestedTarget),
+ };
+ }
+
const missingLinkedInComposer = policy.adapterName === 'linkedin'
&& probe?.success === true && probe?.composerAvailable === false;
const inconclusive = probe?.success !== true || probe?.conclusive !== true || probe?.messageSend !== true;
// Human-readable view of who the page actually addresses, so a mismatch
- // block can name the exact observed recipient instead of asking the user to
- // re-confirm blindly.
+ // block can name the exact observed recipient.
const observedRecipientLabel = (() => {
try {
return (this._messageRecipientCandidates(probe) || [])
@@ -26043,23 +26140,132 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
}
/**
- * Model guidance for a send whose page-observed recipient is not the one
- * the task authorized. It names both, prescribes one clarify that shows the
- * exact observed name, and never suggests retrying without the user's pick:
- * the guard only accepts a bound answer, so a bare retry is blocked again.
+ * What the model reads when a send to an unconfirmed recipient could not be
+ * put to the user (an unattended run) or was not confirmed. It names both
+ * recipients and never asks the model to obtain consent itself: WebBrain
+ * shows the user its own confirmation whenever someone can answer it.
*/
_recipientMismatchGuidance(observedRecipientLabel, target) {
const planned = normalizeMessageTarget(target)?.target_kind === 'named'
? normalizeMessageTarget(target).recipients.map(recipient => recipient.identity).slice(0, 3).join(', ')
: '';
- const name = observedRecipientLabel || '<observed address>';
- return `Message send blocked: this send would go to ${observedRecipientLabel ? `"${observedRecipientLabel}"` : 'a recipient'}, which is not ${planned ? `exactly the recipient named for this task ("${planned}")` : 'the conversation authorized for this task'}, so nothing was dispatched. Do not retry with different targeting.
-Ask the user once whether to send it there. Put that exact name in the question and as an option, because authorization binds to what the page shows and a bare "yes" cannot authorize a send:
-clarify({ question: "Send it to ${name} instead?", options: ["${name}", "Cancel"] })
-If the task sends more than one message, also offer "Send all remaining messages in this task without asking again".
-- If they pick the name: that recipient is authorized for the rest of this task, so retry the send and continue normally.
-- If they pick "Send all remaining messages": every remaining send in this task is authorized, so keep going without asking again.
-- If they pick "Cancel": stop and report that the send was not authorized.`;
+ return `Message send blocked: this send would go to ${observedRecipientLabel ? `"${observedRecipientLabel}"` : 'a recipient'}, which is not ${planned ? `exactly the recipient named for this task ("${planned}")` : 'the conversation authorized for this task'}, and the user has not confirmed it, so nothing was sent. Do not retry with different targeting. Report that the message was not sent and name both recipients, or open the conversation the user asked for.`;
+ }
+
+ _declinedRecipientBlock(recipients = []) {
+ const label = recipients.map(item => item?.identity || item).filter(Boolean).slice(0, 3).join(', ');
+ return {
+ success: false,
+ blocked: true,
+ noDispatch: true,
+ dispatched: false,
+ messageRecipientGuard: true,
+ retryable: false,
+ recipientDeclined: true,
+ reasonCode: 'recipient_declined',
+ error: `The user chose not to send to ${label ? `"${label}"` : 'this recipient'}, so nothing was sent. Do not retry this send. If the user named someone else, open that conversation; otherwise report that the message was not sent.`,
+ };
+ }
+
+ /**
+ * Ask the user, on WebBrain's own card, whether a send may go to the
+ * recipients the page shows. Fixed choices return stable values, so there
+ * is no wording to interpret: 'once' approves these recipients for the rest
+ * of the task, 'always' every remaining send of the task (offered only for
+ * tasks with several recipients), anything else declines. Like permission
+ * prompts it never times out; Stop cancels it (null).
+ */
+ async _promptRecipientConfirmation(tabId, confirmation, onUpdate) {
+ const clarifyId = `recipient_${secureRandomBase36Token(12)}`;
+ const tabPending = this._pendingClarifications.get(tabId) || new Map();
+ this._pendingClarifications.set(tabId, tabPending);
+ const responsePromise = new Promise((resolve) => {
+ tabPending.set(clarifyId, { resolve, ts: Date.now() });
+ });
+ const recipients = (confirmation?.recipients || []).slice(0, 16);
+ const names = recipients.map(item => item.identity).join(', ');
+ try {
+ onUpdate('clarify', {
+ promptKind: 'recipientConfirmation',
+ clarifyId,
+ recipientConfirmation: {
+ recipients,
+ requested: (confirmation?.requested || []).slice(0, 8),
+ host: String(confirmation?.host || '').slice(0, 300),
+ offerAll: confirmation?.offerAll === true,
+ },
+ question: `Send to ${names}?`,
+ options: confirmation?.offerAll === true ? ['once', 'always', 'deny'] : ['once', 'deny'],
+ });
+ } catch { /* UI emit must never break the run */ }
+ const response = await responsePromise;
+ tabPending.delete(clarifyId);
+ if (tabPending.size === 0 && this._pendingClarifications.get(tabId) === tabPending) this._pendingClarifications.delete(tabId);
+ if (response?.cancelled) return null;
+ if (['timeout', 'auto'].includes(response?.source)) return 'deny';
+ const value = String(response?.answer || '').trim().toLowerCase();
+ if (value === 'once') return 'once';
+ if (value === 'always' && confirmation?.offerAll === true) return 'always';
+ return 'deny';
+ }
+
+ _approveConfirmedRecipients(tabId, confirmation, all = false) {
+ const guard = this._planExecutionGuards.get(tabId);
+ const target = normalizeMessageTarget({ target_kind: 'named', recipients: confirmation?.recipients || [] });
+ if (!guard || !target) return false;
+ if (!guard.requestedMessaging) guard.requestedMessaging = normalizeMessageTarget(guard.messaging);
+ guard.messaging = target;
+ const approved = Array.isArray(guard.approvedRecipients) ? guard.approvedRecipients.slice() : [];
+ for (const recipient of target.recipients) {
+ const identity = normalizeRecipientIdentity(recipient.identity);
+ if (identity && !approved.includes(identity)) approved.push(identity);
+ }
+ guard.approvedRecipients = approved;
+ if (all) guard.messageRecipientApprovedAll = true;
+ guard.pendingRecipientAuthorization = false;
+ guard.observedRecipientCandidates = null;
+ return true;
+ }
+
+ /**
+ * Resolve a guard result that only lacks the user's confirmation of the
+ * recipient: ask once on WebBrain's card, record the choice, and re-run the
+ * guard so the send binds to a fresh observation of the same page. Returns
+ * null when the send may proceed, otherwise the result for the model. An
+ * unattended run cannot be asked, so its block is returned unchanged.
+ */
+ async _resolveMessageRecipientConfirmation(tabId, block, onUpdate, rerunGuard, { allowPrompt = true } = {}) {
+ const confirmation = block?.recipientConfirmation;
+ if (!confirmation || !allowPrompt || typeof onUpdate !== 'function') return block;
+ const choice = await this._promptRecipientConfirmation(tabId, confirmation, onUpdate);
+ if (choice === null) {
+ return { success: false, cancelled: true, blocked: true, noDispatch: true, dispatched: false,
+ messageRecipientGuard: true, recipientConfirmationCancelled: true, reasonCode: 'recipient_confirmation_cancelled',
+ error: 'Stopped before the recipient was confirmed. Nothing was sent.' };
+ }
+ if (choice === 'deny') {
+ const guard = this._planExecutionGuards.get(tabId);
+ if (guard) {
+ const declined = Array.isArray(guard.declinedRecipients) ? guard.declinedRecipients.slice() : [];
+ for (const item of confirmation.recipients || []) {
+ const identity = normalizeRecipientIdentity(item?.identity);
+ if (identity && !declined.includes(identity)) declined.push(identity);
+ }
+ guard.declinedRecipients = declined;
+ }
+ return this._declinedRecipientBlock(confirmation.recipients);
+ }
+ if (!this._approveConfirmedRecipients(tabId, confirmation, choice === 'always')) {
+ return { ...block, recipientConfirmation: undefined };
+ }
+ const next = await rerunGuard();
+ if (next?.recipientConfirmation) {
+ const label = (next.recipientConfirmation.recipients || []).map(item => item.identity).join(', ');
+ const { recipientConfirmation, ...changed } = next;
+ return { ...changed, reasonCode: 'recipient_changed_during_confirmation',
+ error: `The open conversation changed to "${label}" while the user was confirming a different recipient, so nothing was sent. Re-read the page; if this is the conversation the user asked for, retry the send and WebBrain will ask the user again.` };
+ }
+ return next;
}
_isRecipientClarification(context, pendingType = 'message_recipient', observedCandidates = []) {
@@ -26235,9 +26441,10 @@ If the task sends more than one message, also offer "Send all remaining messages
/**
* What the model must do after a reply that did not approve the recipient
- * a blocked send would reach. Without this the generic "treat it as
- * authoritative" note reads as approval, the retry is blocked again and the
- * user is asked the same question until the run gives up.
+ * a send would reach. The generic "treat it as authoritative" note read as
+ * approval, so the model retried, was blocked again and asked the same
+ * question. WebBrain now confirms the recipient with the user itself when
+ * the send is tried, so the model never needs to ask again.
*/
_unboundRecipientClarificationNote(outcome = {}) {
const names = (Array.isArray(outcome?.observed) ? outcome.observed : [])
@@ -26246,18 +26453,15 @@ If the task sends more than one message, also offer "Send all remaining messages
.slice(0, 3);
const label = names.join(', ');
const named = label ? ` ("${label}")` : '';
- const example = label
- ? ` For example: clarify({ question: "Send it to ${label}?", options: ["${label}", "Cancel"] }).`
- : '';
+ const card = `If the user meant that recipient, continue with the send: WebBrain shows the user its own confirmation${named} before anything is sent. Do not ask about the recipient again.`;
switch (outcome?.reason) {
case 'answer_refused':
- return `The reply reads as declining or correcting the recipient this send would reach${named}, so nothing was authorized or sent. If the user named someone else, open that conversation and continue there. If it is unclear whether they meant that recipient, ask once more with the exact name as an option.${example} Otherwise stop and report that the send was not authorized.`;
+ return `The reply declines or corrects the recipient this send would reach${named}, so nothing was approved or sent. Do not send there. If the user named someone else, open that conversation and continue there; otherwise stop and report that the message was not sent.`;
case 'answer_does_not_name_recipient':
- return `The reply did not choose the recipient this send would reach${named}, so nothing was authorized or sent. Only an answer that picks that exact name approves it; a reply such as "yes" or "that's the right person" cannot. If the user meant that recipient, ask once more with the exact name in the question and as an option.${example} Otherwise stop and report that the send was not authorized.`;
case 'recipient_not_presented':
- return `The question did not ask the user to approve sending to the recipient this send would reach${named}, so the reply cannot approve it and nothing was sent. Ask once with that exact name in the question and as an option.${example}`;
+ return `The reply did not pick the recipient's exact name, so it approved nothing by itself and nothing was sent. ${card}`;
case 'no_pending_recipient':
- return 'This is a direct reply from the user; continue the task with it in mind. It did not approve a recipient by itself: approval is recorded only when the question shows the exact recipient name the open conversation has, so if a send is blocked, ask then with the exact name the block reports.';
+ return 'This is a direct reply from the user; continue the task with it in mind. If a send would reach someone other than the recipient named for the task, WebBrain asks the user itself; do not ask about the recipient again.';
default:
return '';
}
@@ -38915,7 +39119,7 @@ If the task sends more than one message, also offer "Send all remaining messages
return { success: false, error: 'selector parameter is required for upload_file' };
}
- const recipientUpload = await this._recipientBoundUploadContext(tabId, args, dispatchContext);
+ const recipientUpload = await this._recipientBoundUploadContext(tabId, args, dispatchContext, onUpdate);
throwIfContentPipelineAborted();
if (recipientUpload.block) return recipientUpload.block;
diff --git a/src/firefox/src/agent/message-recipient-guard.js b/src/firefox/src/agent/message-recipient-guard.js
index 02ed63881..a617e0f8c 100644
--- a/src/firefox/src/agent/message-recipient-guard.js
+++ b/src/firefox/src/agent/message-recipient-guard.js
@@ -226,21 +226,22 @@ export function answerNamesAllObservedRecipients(normalizedAnswer, observedCandi
// Stems match at a word start so inflected forms count; scripts written
// without spaces between words match anywhere.
const RECIPIENT_QUESTION_WORD = new RegExp(`(?<![\\p{L}\\p{N}])(?:${[
- 'send', 'sent', 'messag', 'deliver', 'forward', 'shar(?:e|ing)', 'repl(?:y|ies|ying)', 'recipient', 'contact',
+ 'send', 'sent', 'messag', 'deliver', 'forward', 'shar(?:e|ing)', 'repl(?:y|ies|ying)', 'recipient', 'receiv', 'contact',
'conversa', 'chat', 'dms?(?![\\p{L}])', 'e-?mail', 'mail', 'thread', 'inbox', 'person', 'people', 'user', 'account',
'whom', 'address',
- 'gönder', 'ilet', 'yolla', 'mesaj', 'paylaş', 'alıcı', 'kişi', 'kullanıcı', 'hesab', 'hesap', 'sohbet', 'konuşma',
- 'schick', 'nachricht', 'empfänger', 'weiterleit', 'teilen',
+ 'gönder', 'ilet', 'yolla', 'mesaj', 'paylaş', 'alıcı', 'kime', 'kişi', 'kullanıcı', 'hesab', 'hesap', 'sohbet', 'konuşma',
+ 'schick', 'nachricht', 'empfänger', 'erhalt', 'bekomm', 'wem', 'weiterleit', 'teilen',
'envi[aáeéoó]', 'envoy', 'envoi', 'mensaj', 'mensag', 'messagg', 'destinat', 'compart', 'partag', 'partilh',
- 'condivid', 'inoltr', 'reenv', 'transf[eé]r', 'invia', 'invio', 'pessoa', 'contatt',
+ 'condivid', 'inoltr', 'reenv', 'transf[eé]r', 'invia', 'invio', 'pessoa', 'contatt', 'recib', 'reçoi', 'recev',
+ 'receb', 'ricev',
'stuur', 'verstuur', 'verzend', 'bericht', 'ontvanger', 'delen',
'wyśl', 'wysł', 'wiadomo', 'odbiorc', 'udostępn', 'zpráv', 'příjemc',
- 'отправ', 'посла', 'пошл', 'сообщен', 'пересла', 'получател', 'собеседник', 'надісл', 'повідомл', 'одержувач',
+ 'отправ', 'посла', 'пошл', 'сообщен', 'пересла', 'получ', 'собеседник', 'надісл', 'повідомл', 'одержувач',
'kirim', 'pesan', 'penerima', 'bagikan', 'gửi', 'tin nhắn', 'người nhận', 'chia sẻ',
'أرسل', 'ارسل', 'إرسال', 'ارسال', 'رسالة', 'مستلم', 'المستلم', 'بفرست', 'پیام', 'گیرنده',
'שלח', 'הודעה', 'נמען', 'भेज', 'संदेश', 'प्राप्तकर्ता',
].join('|')})`, 'iu');
-const RECIPIENT_QUESTION_UNSPACED = /送|发|發|传|傳|消息|信息|訊息|收件|联系人|聯絡人|メッセージ|宛|보내|전송|메시지|받는|ส่ง|ข้อความ/u;
+const RECIPIENT_QUESTION_UNSPACED = /送|发|發|传|傳|消息|信息|訊息|收|联系人|聯絡人|メッセージ|宛|受け取|보내|전송|메시지|받|ส่ง|ข้อความ/u;
/**
* Does a clarification question show the user the exact recipients the page
diff --git a/src/firefox/src/agent/scheduler.js b/src/firefox/src/agent/scheduler.js
index f500f392e..5cab19866 100644
--- a/src/firefox/src/agent/scheduler.js
+++ b/src/firefox/src/agent/scheduler.js
@@ -143,6 +143,20 @@ function normalizePendingClarify(data, now = Date.now()) {
changedFields: normalizeFields(submitConfirmation.changedFields, 8),
};
}
+ const recipientConfirmation = asObject(obj.recipientConfirmation);
+ if (Array.isArray(recipientConfirmation.recipients) && recipientConfirmation.recipients.length) {
+ pending.recipientConfirmation = {
+ recipients: recipientConfirmation.recipients.slice(0, 16).map((recipient) => {
+ const item = asObject(recipient);
+ return { identity: String(item.identity || '').slice(0, 240), role: ['to', 'cc', 'bcc'].includes(item.role) ? item.role : 'to' };
+ }).filter((recipient) => recipient.identity),
+ requested: Array.isArray(recipientConfirmation.requested)
+ ? recipientConfirmation.requested.slice(0, 8).map((value) => String(value).slice(0, 240)).filter(Boolean)
+ : [],
+ host: String(recipientConfirmation.host || '').slice(0, 300),
+ offerAll: recipientConfirmation.offerAll === true,
+ };
+ }
return pending;
}
diff --git a/src/firefox/src/agent/tools.js b/src/firefox/src/agent/tools.js
index c6a669d96..30dc2225a 100644
--- a/src/firefox/src/agent/tools.js
+++ b/src/firefox/src/agent/tools.js
@@ -768,7 +768,7 @@ export const AGENT_TOOLS = [
purpose: {
type: 'string',
enum: ['research_escalation', 'message_recipient', 'recipient_change'],
- description: 'Optional purpose of the clarification. Use message_recipient to ask the user to confirm or specify the message/email recipient, recipient_change to switch an already-authorized recipient, or research_escalation to delegate a read-only research subtask.',
+ description: 'Optional purpose of the clarification. Use message_recipient to ask the user who should receive a message, recipient_change to switch an already-authorized recipient, or research_escalation to delegate a read-only research subtask. Do not ask the user to confirm the recipient of a send that is already prepared: WebBrain confirms it with the user itself before sending.',
},
research_request: {
type: 'string',
diff --git a/src/firefox/src/ui/locales/ar.js b/src/firefox/src/ui/locales/ar.js
index 78b0ace08..9ea25809e 100644
--- a/src/firefox/src/ui/locales/ar.js
+++ b/src/firefox/src/ui/locales/ar.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "السماح مرة واحدة",
'sp.perm.always_allow': "السماح دائمًا على {host}",
'sp.perm.dont_allow': "عدم السماح",
+ "sp.recipient.question": "هل تريد الإرسال إلى {recipient}؟",
+ "sp.recipient.reason_requested": "ذكر طلبك «{requested}». المحادثة المفتوحة على {host} مع {recipient}.",
+ "sp.recipient.reason_open": "المحادثة المفتوحة على {host} مع {recipient}.",
+ "sp.recipient.send": "إرسال إلى {recipient}",
+ "sp.recipient.send_all": "إرسال وعدم السؤال مرة أخرى في هذه المهمة",
+ "sp.recipient.dont_send": "عدم الإرسال",
'st.tab.permissions': "الأذونات",
'st.perms.revoke': "إلغاء",
'st.perms.clear_all': "مسح كل الأذونات",
diff --git a/src/firefox/src/ui/locales/bn.js b/src/firefox/src/ui/locales/bn.js
index 8782c9636..0c657676d 100644
--- a/src/firefox/src/ui/locales/bn.js
+++ b/src/firefox/src/ui/locales/bn.js
@@ -385,6 +385,12 @@ export default {
'sp.perm.allow_once': "একবার অনুমতি দিন",
'sp.perm.always_allow': "সবসময় {host} এ অনুমতি দিন",
'sp.perm.dont_allow': "অনুমতি দেবেন না",
+ "sp.recipient.question": "{recipient}-কে পাঠাবেন?",
+ "sp.recipient.reason_requested": "আপনার অনুরোধে “{requested}” ছিল। {host}-এ খোলা কথোপকথনটি {recipient}-এর সাথে।",
+ "sp.recipient.reason_open": "{host}-এ খোলা কথোপকথনটি {recipient}-এর সাথে।",
+ "sp.recipient.send": "{recipient}-কে পাঠান",
+ "sp.recipient.send_all": "পাঠান, এবং এই কাজে আর জিজ্ঞাসা করবেন না",
+ "sp.recipient.dont_send": "পাঠাবেন না",
'sp.perm.skip_hint': "কম বাধা চান? \"সর্বদা অনুমতি দিন\" এই সাইটটি মনে রাখে। নীচের কমান্ড প্রতিটি সাইটে WebBrain অনুমতি অনুরোধ নিষ্ক্রিয় করে।",
'sp.perm.insert_skip_command': "/dangerously-skip-permissions ঢোকান",
'sp.perm.skip_hint_draft': "আপনার খসড়া অপরিবর্তিত. কমান্ড সন্নিবেশ করার আগে এটি সাফ করুন।",
diff --git a/src/firefox/src/ui/locales/de.js b/src/firefox/src/ui/locales/de.js
index dcc34a040..6d9a8dc3e 100644
--- a/src/firefox/src/ui/locales/de.js
+++ b/src/firefox/src/ui/locales/de.js
@@ -397,6 +397,12 @@ export default {
'sp.perm.allow_once': 'Einmal erlauben',
'sp.perm.always_allow': 'Immer erlauben auf {host}',
'sp.perm.dont_allow': 'Nicht erlauben',
+ "sp.recipient.question": "An {recipient} senden?",
+ "sp.recipient.reason_requested": "Deine Anfrage nannte „{requested}“. Die geöffnete Unterhaltung auf {host} ist mit {recipient}.",
+ "sp.recipient.reason_open": "Die geöffnete Unterhaltung auf {host} ist mit {recipient}.",
+ "sp.recipient.send": "An {recipient} senden",
+ "sp.recipient.send_all": "Senden und in dieser Aufgabe nicht mehr fragen",
+ "sp.recipient.dont_send": "Nicht senden",
'sp.perm.skip_hint': 'Weniger Unterbrechungen? „Immer erlauben" merkt sich diese Website. Der Befehl unten deaktiviert WebBrain-Berechtigungsabfragen auf allen Websites.',
'sp.perm.insert_skip_command': '/dangerously-skip-permissions einfügen',
'sp.perm.skip_hint_draft': 'Ihr Entwurf bleibt unverändert. Löschen Sie ihn, bevor Sie den Befehl einfügen.',
diff --git a/src/firefox/src/ui/locales/en.js b/src/firefox/src/ui/locales/en.js
index 69e7ffa85..4f5a87dc5 100644
--- a/src/firefox/src/ui/locales/en.js
+++ b/src/firefox/src/ui/locales/en.js
@@ -390,6 +390,12 @@ export default {
'sp.perm.allow_once': 'Allow once',
'sp.perm.always_allow': 'Always allow on {host}',
'sp.perm.dont_allow': "Don't allow",
+ "sp.recipient.question": "Send to {recipient}?",
+ "sp.recipient.reason_requested": "Your request named “{requested}”. The open conversation on {host} is with {recipient}.",
+ "sp.recipient.reason_open": "The open conversation on {host} is with {recipient}.",
+ "sp.recipient.send": "Send to {recipient}",
+ "sp.recipient.send_all": "Send, and don’t ask again in this task",
+ "sp.recipient.dont_send": "Don’t send",
'sp.perm.skip_hint': 'Want fewer interruptions? “Always allow” remembers this site. The command below disables WebBrain permission prompts on every site.',
'sp.perm.insert_skip_command': 'Insert /dangerously-skip-permissions',
'sp.perm.skip_hint_draft': 'Your draft is unchanged. Clear it before inserting the command.',
diff --git a/src/firefox/src/ui/locales/es.js b/src/firefox/src/ui/locales/es.js
index cdd8e6761..fec931b2e 100644
--- a/src/firefox/src/ui/locales/es.js
+++ b/src/firefox/src/ui/locales/es.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "Permitir una vez",
'sp.perm.always_allow': "Permitir siempre en {host}",
'sp.perm.dont_allow': "No permitir",
+ "sp.recipient.question": "¿Enviar a {recipient}?",
+ "sp.recipient.reason_requested": "Tu solicitud mencionaba «{requested}». La conversación abierta en {host} es con {recipient}.",
+ "sp.recipient.reason_open": "La conversación abierta en {host} es con {recipient}.",
+ "sp.recipient.send": "Enviar a {recipient}",
+ "sp.recipient.send_all": "Enviar y no volver a preguntar en esta tarea",
+ "sp.recipient.dont_send": "No enviar",
'st.tab.permissions': "Permisos",
'st.perms.revoke': "Revocar",
'st.perms.clear_all': "Borrar todos los permisos",
diff --git a/src/firefox/src/ui/locales/fa.js b/src/firefox/src/ui/locales/fa.js
index 80ec0e6b6..048784e9a 100644
--- a/src/firefox/src/ui/locales/fa.js
+++ b/src/firefox/src/ui/locales/fa.js
@@ -385,6 +385,12 @@ export default {
'sp.perm.allow_once': "یکبار اجازه دهید",
'sp.perm.always_allow': "{host} همیشه مجاز باشد",
'sp.perm.dont_allow': "اجازه نده",
+ "sp.recipient.question": "به {recipient} ارسال شود؟",
+ "sp.recipient.reason_requested": "در درخواست شما «{requested}» آمده بود. گفتگوی باز در {host} با {recipient} است.",
+ "sp.recipient.reason_open": "گفتگوی باز در {host} با {recipient} است.",
+ "sp.recipient.send": "ارسال به {recipient}",
+ "sp.recipient.send_all": "ارسال کن و در این کار دیگر نپرس",
+ "sp.recipient.dont_send": "ارسال نکن",
'sp.perm.skip_hint': "وقفه های کمتری می خواهید؟ \"همیشه اجازه دهید\" این سایت را به خاطر می آورد. دستور زیر دستورات مجوز WebBrain را در هر سایت غیرفعال می کند.",
'sp.perm.insert_skip_command': "/dangerously-skip-permissions را درج کنید",
'sp.perm.skip_hint_draft': "پیش نویس شما بدون تغییر است. قبل از وارد کردن دستور آن را پاک کنید.",
diff --git a/src/firefox/src/ui/locales/fr.js b/src/firefox/src/ui/locales/fr.js
index 5d8cbb355..ac0140aca 100644
--- a/src/firefox/src/ui/locales/fr.js
+++ b/src/firefox/src/ui/locales/fr.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "Autoriser une fois",
'sp.perm.always_allow': "Toujours autoriser sur {host}",
'sp.perm.dont_allow': "Ne pas autoriser",
+ "sp.recipient.question": "Envoyer à {recipient} ?",
+ "sp.recipient.reason_requested": "Votre demande mentionnait « {requested} ». La conversation ouverte sur {host} est avec {recipient}.",
+ "sp.recipient.reason_open": "La conversation ouverte sur {host} est avec {recipient}.",
+ "sp.recipient.send": "Envoyer à {recipient}",
+ "sp.recipient.send_all": "Envoyer sans redemander pendant cette tâche",
+ "sp.recipient.dont_send": "Ne pas envoyer",
'st.tab.permissions': "Autorisations",
'st.perms.revoke': "Révoquer",
'st.perms.clear_all': "Effacer toutes les autorisations",
diff --git a/src/firefox/src/ui/locales/he.js b/src/firefox/src/ui/locales/he.js
index 5b36f8e3d..320eca8b3 100644
--- a/src/firefox/src/ui/locales/he.js
+++ b/src/firefox/src/ui/locales/he.js
@@ -376,6 +376,12 @@ export default {
"sp.perm.allow_once": "אפשר פעם אחת",
"sp.perm.always_allow": "אפשר תמיד {host}",
"sp.perm.dont_allow": "אל תאפשר",
+ "sp.recipient.question": "לשלוח אל {recipient}?",
+ "sp.recipient.reason_requested": "בבקשה שלך צוין \"{requested}\". השיחה הפתוחה ב-{host} היא עם {recipient}.",
+ "sp.recipient.reason_open": "השיחה הפתוחה ב-{host} היא עם {recipient}.",
+ "sp.recipient.send": "לשלוח אל {recipient}",
+ "sp.recipient.send_all": "לשלוח ולא לשאול שוב במשימה הזו",
+ "sp.recipient.dont_send": "לא לשלוח",
"sp.perm.verb.navigate": "לנווט אל",
"sp.perm.verb.click": "לחץ/שלח על",
"sp.perm.verb.type": "הקלד לתוך",
diff --git a/src/firefox/src/ui/locales/hi.js b/src/firefox/src/ui/locales/hi.js
index 9dbb6d213..8b48e7351 100644
--- a/src/firefox/src/ui/locales/hi.js
+++ b/src/firefox/src/ui/locales/hi.js
@@ -385,6 +385,12 @@ export default {
'sp.perm.allow_once': "एक बार अनुमति दें",
'sp.perm.always_allow': "हमेशा {host} पर अनुमति दें",
'sp.perm.dont_allow': "अनुमति न दें",
+ "sp.recipient.question": "{recipient} को भेजें?",
+ "sp.recipient.reason_requested": "आपके अनुरोध में “{requested}” था। {host} पर खुली बातचीत {recipient} के साथ है।",
+ "sp.recipient.reason_open": "{host} पर खुली बातचीत {recipient} के साथ है।",
+ "sp.recipient.send": "{recipient} को भेजें",
+ "sp.recipient.send_all": "भेजें, और इस कार्य में दोबारा न पूछें",
+ "sp.recipient.dont_send": "न भेजें",
'sp.perm.skip_hint': "क्या आप कम रुकावटें चाहते हैं? \"हमेशा अनुमति दें\" यह साइट याद रखती है। नीचे दिया गया आदेश प्रत्येक साइट पर WebBrain अनुमति संकेतों को अक्षम कर देता है।",
'sp.perm.insert_skip_command': "/dangerously-skip-permissions डालें",
'sp.perm.skip_hint_draft': "आपका ड्राफ्ट अपरिवर्तित है. कमांड डालने से पहले इसे साफ़ करें।",
diff --git a/src/firefox/src/ui/locales/id.js b/src/firefox/src/ui/locales/id.js
index eb4571685..ee7de73d8 100644
--- a/src/firefox/src/ui/locales/id.js
+++ b/src/firefox/src/ui/locales/id.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "Izinkan sekali",
'sp.perm.always_allow': "Selalu izinkan di {host}",
'sp.perm.dont_allow': "Jangan izinkan",
+ "sp.recipient.question": "Kirim ke {recipient}?",
+ "sp.recipient.reason_requested": "Permintaan Anda menyebut “{requested}”. Percakapan yang terbuka di {host} adalah dengan {recipient}.",
+ "sp.recipient.reason_open": "Percakapan yang terbuka di {host} adalah dengan {recipient}.",
+ "sp.recipient.send": "Kirim ke {recipient}",
+ "sp.recipient.send_all": "Kirim, dan jangan tanya lagi dalam tugas ini",
+ "sp.recipient.dont_send": "Jangan kirim",
'st.tab.permissions': "Izin",
'st.perms.revoke': "Cabut",
'st.perms.clear_all': "Hapus semua izin",
diff --git a/src/firefox/src/ui/locales/ja.js b/src/firefox/src/ui/locales/ja.js
index 6bc36b07d..22e6550df 100644
--- a/src/firefox/src/ui/locales/ja.js
+++ b/src/firefox/src/ui/locales/ja.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "今回のみ許可",
'sp.perm.always_allow': "{host} で常に許可",
'sp.perm.dont_allow': "許可しない",
+ "sp.recipient.question": "{recipient} に送信しますか?",
+ "sp.recipient.reason_requested": "リクエストでは「{requested}」と指定されていました。{host} で開いている会話の相手は {recipient} です。",
+ "sp.recipient.reason_open": "{host} で開いている会話の相手は {recipient} です。",
+ "sp.recipient.send": "{recipient} に送信",
+ "sp.recipient.send_all": "送信し、このタスクでは今後確認しない",
+ "sp.recipient.dont_send": "送信しない",
'st.tab.permissions': "権限",
'st.perms.revoke': "取り消す",
'st.perms.clear_all': "すべての権限を消去",
diff --git a/src/firefox/src/ui/locales/ko.js b/src/firefox/src/ui/locales/ko.js
index f4d4cbabf..1351546f8 100644
--- a/src/firefox/src/ui/locales/ko.js
+++ b/src/firefox/src/ui/locales/ko.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "한 번 허용",
'sp.perm.always_allow': "{host}에서 항상 허용",
'sp.perm.dont_allow': "허용 안 함",
+ "sp.recipient.question": "{recipient}에게 보낼까요?",
+ "sp.recipient.reason_requested": "요청에는 “{requested}”(이)라고 되어 있었습니다. {host}에서 열려 있는 대화 상대는 {recipient}입니다.",
+ "sp.recipient.reason_open": "{host}에서 열려 있는 대화 상대는 {recipient}입니다.",
+ "sp.recipient.send": "{recipient}에게 보내기",
+ "sp.recipient.send_all": "보내고 이 작업에서는 다시 묻지 않기",
+ "sp.recipient.dont_send": "보내지 않기",
'st.tab.permissions': "권한",
'st.perms.revoke': "취소",
'st.perms.clear_all': "모든 권한 지우기",
diff --git a/src/firefox/src/ui/locales/ms.js b/src/firefox/src/ui/locales/ms.js
index b8eb5596e..df2de7352 100644
--- a/src/firefox/src/ui/locales/ms.js
+++ b/src/firefox/src/ui/locales/ms.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "Benarkan sekali",
'sp.perm.always_allow': "Sentiasa benarkan di {host}",
'sp.perm.dont_allow': "Jangan benarkan",
+ "sp.recipient.question": "Hantar kepada {recipient}?",
+ "sp.recipient.reason_requested": "Permintaan anda menyebut “{requested}”. Perbualan yang terbuka di {host} adalah dengan {recipient}.",
+ "sp.recipient.reason_open": "Perbualan yang terbuka di {host} adalah dengan {recipient}.",
+ "sp.recipient.send": "Hantar kepada {recipient}",
+ "sp.recipient.send_all": "Hantar, dan jangan tanya lagi dalam tugasan ini",
+ "sp.recipient.dont_send": "Jangan hantar",
'st.tab.permissions': "Kebenaran",
'st.perms.revoke': "Batalkan",
'st.perms.clear_all': "Kosongkan semua kebenaran",
diff --git a/src/firefox/src/ui/locales/nl.js b/src/firefox/src/ui/locales/nl.js
index 491d4040b..ce6801ed6 100644
--- a/src/firefox/src/ui/locales/nl.js
+++ b/src/firefox/src/ui/locales/nl.js
@@ -373,6 +373,12 @@ export default {
'sp.perm.allow_once': 'Eenmaal toestaan',
'sp.perm.always_allow': 'Altijd toestaan op {host}',
'sp.perm.dont_allow': 'Niet toestaan',
+ "sp.recipient.question": "Naar {recipient} sturen?",
+ "sp.recipient.reason_requested": "Je verzoek noemde ‘{requested}’. Het geopende gesprek op {host} is met {recipient}.",
+ "sp.recipient.reason_open": "Het geopende gesprek op {host} is met {recipient}.",
+ "sp.recipient.send": "Naar {recipient} sturen",
+ "sp.recipient.send_all": "Sturen en in deze taak niet meer vragen",
+ "sp.recipient.dont_send": "Niet sturen",
'sp.perm.skip_hint': 'Minder onderbrekingen? "Altijd toestaan" onthoudt deze site. Het onderstaande commando schakelt WebBrain-machtigingsvragen uit op elke site.',
'sp.perm.insert_skip_command': 'Voeg /dangerously-skip-permissions toe',
'sp.perm.skip_hint_draft': 'Uw concept is ongewijzigd. Wis het voordat u het commando toevoegt.',
diff --git a/src/firefox/src/ui/locales/pl.js b/src/firefox/src/ui/locales/pl.js
index f33aa1a8b..42068d477 100644
--- a/src/firefox/src/ui/locales/pl.js
+++ b/src/firefox/src/ui/locales/pl.js
@@ -282,6 +282,12 @@ export default {
'sp.perm.allow_once': 'Zezwól raz',
'sp.perm.always_allow': 'Zawsze zezwalaj na {host}',
'sp.perm.dont_allow': 'Nie zezwalaj',
+ "sp.recipient.question": "Wysłać do {recipient}?",
+ "sp.recipient.reason_requested": "Twoja prośba wskazywała „{requested}”. Otwarta rozmowa w {host} jest z {recipient}.",
+ "sp.recipient.reason_open": "Otwarta rozmowa w {host} jest z {recipient}.",
+ "sp.recipient.send": "Wyślij do {recipient}",
+ "sp.recipient.send_all": "Wyślij i nie pytaj ponownie w tym zadaniu",
+ "sp.recipient.dont_send": "Nie wysyłaj",
'sp.perm.verb.navigate': 'przejść do',
'sp.perm.verb.click': 'kliknąć / wysłać na',
'sp.perm.verb.type': 'wpisać w',
diff --git a/src/firefox/src/ui/locales/pt.js b/src/firefox/src/ui/locales/pt.js
index 3652f975c..24f74fd58 100644
--- a/src/firefox/src/ui/locales/pt.js
+++ b/src/firefox/src/ui/locales/pt.js
@@ -385,6 +385,12 @@ export default {
'sp.perm.allow_once': "Permitir uma vez",
'sp.perm.always_allow': "Sempre permitir em {host}",
'sp.perm.dont_allow': "Não permita",
+ "sp.recipient.question": "Enviar para {recipient}?",
+ "sp.recipient.reason_requested": "Seu pedido mencionava “{requested}”. A conversa aberta em {host} é com {recipient}.",
+ "sp.recipient.reason_open": "A conversa aberta em {host} é com {recipient}.",
+ "sp.recipient.send": "Enviar para {recipient}",
+ "sp.recipient.send_all": "Enviar e não perguntar de novo nesta tarefa",
+ "sp.recipient.dont_send": "Não enviar",
'sp.perm.skip_hint': "Quer menos interrupções? “Sempre permitir” lembra este site. O comando abaixo desativa os prompts de permissão WebBrain em todos os sites.",
'sp.perm.insert_skip_command': "Insira /dangerously-skip-permissions",
'sp.perm.skip_hint_draft': "Seu rascunho permanece inalterado. Limpe-o antes de inserir o comando.",
diff --git a/src/firefox/src/ui/locales/ru.js b/src/firefox/src/ui/locales/ru.js
index ba29f7ce5..6fb3a1f6a 100644
--- a/src/firefox/src/ui/locales/ru.js
+++ b/src/firefox/src/ui/locales/ru.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "Разрешить один раз",
'sp.perm.always_allow': "Всегда разрешать на {host}",
'sp.perm.dont_allow': "Не разрешать",
+ "sp.recipient.question": "Отправить получателю {recipient}?",
+ "sp.recipient.reason_requested": "В запросе указано «{requested}». Открытый диалог на {host}: {recipient}.",
+ "sp.recipient.reason_open": "Открытый диалог на {host}: {recipient}.",
+ "sp.recipient.send": "Отправить получателю {recipient}",
+ "sp.recipient.send_all": "Отправить и больше не спрашивать в этой задаче",
+ "sp.recipient.dont_send": "Не отправлять",
'st.tab.permissions': "Разрешения",
'st.perms.revoke': "Отозвать",
'st.perms.clear_all': "Очистить все разрешения",
diff --git a/src/firefox/src/ui/locales/th.js b/src/firefox/src/ui/locales/th.js
index 94957cc4c..25a9b985c 100644
--- a/src/firefox/src/ui/locales/th.js
+++ b/src/firefox/src/ui/locales/th.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "อนุญาตครั้งเดียว",
'sp.perm.always_allow': "อนุญาตเสมอบน {host}",
'sp.perm.dont_allow': "ไม่อนุญาต",
+ "sp.recipient.question": "ส่งถึง {recipient} ไหม?",
+ "sp.recipient.reason_requested": "คำขอของคุณระบุ “{requested}” บทสนทนาที่เปิดอยู่บน {host} คือกับ {recipient}",
+ "sp.recipient.reason_open": "บทสนทนาที่เปิดอยู่บน {host} คือกับ {recipient}",
+ "sp.recipient.send": "ส่งถึง {recipient}",
+ "sp.recipient.send_all": "ส่ง และไม่ต้องถามอีกในงานนี้",
+ "sp.recipient.dont_send": "ไม่ส่ง",
'st.tab.permissions': "สิทธิ์",
'st.perms.revoke': "เพิกถอน",
'st.perms.clear_all': "ล้างสิทธิ์ทั้งหมด",
diff --git a/src/firefox/src/ui/locales/tl.js b/src/firefox/src/ui/locales/tl.js
index d76c69dd6..d3fe41562 100644
--- a/src/firefox/src/ui/locales/tl.js
+++ b/src/firefox/src/ui/locales/tl.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "Payagan minsan",
'sp.perm.always_allow': "Palaging payagan sa {host}",
'sp.perm.dont_allow': "Huwag payagan",
+ "sp.recipient.question": "Ipadala kay {recipient}?",
+ "sp.recipient.reason_requested": "Binanggit ng iyong kahilingan ang “{requested}”. Ang bukas na usapan sa {host} ay kay {recipient}.",
+ "sp.recipient.reason_open": "Ang bukas na usapan sa {host} ay kay {recipient}.",
+ "sp.recipient.send": "Ipadala kay {recipient}",
+ "sp.recipient.send_all": "Ipadala, at huwag nang magtanong muli sa gawaing ito",
+ "sp.recipient.dont_send": "Huwag ipadala",
'st.tab.permissions': "Mga pahintulot",
'st.perms.revoke': "Bawiin",
'st.perms.clear_all': "I-clear ang lahat ng pahintulot",
diff --git a/src/firefox/src/ui/locales/tr.js b/src/firefox/src/ui/locales/tr.js
index c32d277e8..78bf2c11f 100644
--- a/src/firefox/src/ui/locales/tr.js
+++ b/src/firefox/src/ui/locales/tr.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "Bir kez izin ver",
'sp.perm.always_allow': "{host} için her zaman izin ver",
'sp.perm.dont_allow': "İzin verme",
+ "sp.recipient.question": "{recipient} adlı kişiye gönderilsin mi?",
+ "sp.recipient.reason_requested": "İsteğinde “{requested}” yazıyordu. {host} üzerinde açık olan sohbet: {recipient}.",
+ "sp.recipient.reason_open": "{host} üzerinde açık olan sohbet: {recipient}.",
+ "sp.recipient.send": "{recipient} adlı kişiye gönder",
+ "sp.recipient.send_all": "Gönder, bu görevde bir daha sorma",
+ "sp.recipient.dont_send": "Gönderme",
'st.tab.permissions': "İzinler",
'st.tab.skills': 'Skills',
'st.perms.revoke': "Kaldır",
diff --git a/src/firefox/src/ui/locales/uk.js b/src/firefox/src/ui/locales/uk.js
index a289180fc..57faf9082 100644
--- a/src/firefox/src/ui/locales/uk.js
+++ b/src/firefox/src/ui/locales/uk.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "Дозволити один раз",
'sp.perm.always_allow': "Завжди дозволяти на {host}",
'sp.perm.dont_allow': "Не дозволяти",
+ "sp.recipient.question": "Надіслати отримувачу {recipient}?",
+ "sp.recipient.reason_requested": "У запиті вказано «{requested}». Відкрита розмова на {host}: {recipient}.",
+ "sp.recipient.reason_open": "Відкрита розмова на {host}: {recipient}.",
+ "sp.recipient.send": "Надіслати отримувачу {recipient}",
+ "sp.recipient.send_all": "Надіслати й більше не питати в цьому завданні",
+ "sp.recipient.dont_send": "Не надсилати",
'st.tab.permissions': "Дозволи",
'st.perms.revoke': "Відкликати",
'st.perms.clear_all': "Очистити всі дозволи",
diff --git a/src/firefox/src/ui/locales/vi.js b/src/firefox/src/ui/locales/vi.js
index e1dfd3874..d6dcfcc65 100644
--- a/src/firefox/src/ui/locales/vi.js
+++ b/src/firefox/src/ui/locales/vi.js
@@ -385,6 +385,12 @@ export default {
'sp.perm.allow_once': "Cho phép một lần",
'sp.perm.always_allow': "Luôn cho phép trên {host}",
'sp.perm.dont_allow': "Không cho phép",
+ "sp.recipient.question": "Gửi cho {recipient}?",
+ "sp.recipient.reason_requested": "Yêu cầu của bạn ghi “{requested}”. Cuộc trò chuyện đang mở trên {host} là với {recipient}.",
+ "sp.recipient.reason_open": "Cuộc trò chuyện đang mở trên {host} là với {recipient}.",
+ "sp.recipient.send": "Gửi cho {recipient}",
+ "sp.recipient.send_all": "Gửi và không hỏi lại trong tác vụ này",
+ "sp.recipient.dont_send": "Không gửi",
'sp.perm.skip_hint': "Muốn ít bị gián đoạn hơn? “Luôn cho phép” ghi nhớ trang web này. Lệnh bên dưới vô hiệu hóa lời nhắc cấp phép WebBrain trên mọi trang web.",
'sp.perm.insert_skip_command': "Chèn /dangerously-skip-permissions",
'sp.perm.skip_hint_draft': "Bản nháp của bạn không thay đổi. Xóa nó trước khi chèn lệnh.",
diff --git a/src/firefox/src/ui/locales/zh.js b/src/firefox/src/ui/locales/zh.js
index 713f1469e..e7c01ed54 100644
--- a/src/firefox/src/ui/locales/zh.js
+++ b/src/firefox/src/ui/locales/zh.js
@@ -78,6 +78,12 @@ export default {
'sp.perm.allow_once': "允许一次",
'sp.perm.always_allow': "始终允许 {host}",
'sp.perm.dont_allow': "不允许",
+ "sp.recipient.question": "发送给 {recipient}?",
+ "sp.recipient.reason_requested": "你的请求中写的是“{requested}”。{host} 上打开的对话对象是 {recipient}。",
+ "sp.recipient.reason_open": "{host} 上打开的对话对象是 {recipient}。",
+ "sp.recipient.send": "发送给 {recipient}",
+ "sp.recipient.send_all": "发送,并在此任务中不再询问",
+ "sp.recipient.dont_send": "不发送",
'st.tab.permissions': "权限",
'st.perms.revoke': "撤销",
'st.perms.clear_all': "清除所有权限",
diff --git a/src/firefox/src/ui/sidepanel.js b/src/firefox/src/ui/sidepanel.js
index 7606c137a..152cbbd57 100644
--- a/src/firefox/src/ui/sidepanel.js
+++ b/src/firefox/src/ui/sidepanel.js
@@ -6134,7 +6134,8 @@ function rebindClarifyCards() {
// Restart countdown after HTML restore when timeout metadata survived on
// the card. Skip permission/form-submit cards (they never auto-timeout).
- if (card.dataset.permission === '1' || card.dataset.submitConfirmation === '1') return;
+ if (card.dataset.permission === '1' || card.dataset.submitConfirmation === '1'
+ || card.dataset.recipientConfirmation === '1') return;
const deadlineTs = Number(card.dataset.deadlineTs);
if (!Number.isFinite(deadlineTs) || deadlineTs <= 0) return;
const firstOption = card.dataset.firstOption
@@ -10659,7 +10660,7 @@ function renderClarifyCard(data) {
if (data.pendingReconciliation === true) card.dataset.pendingReconciliation = '1';
card.dataset.memorySource = scheduledJobId
? 'scheduled_clarification'
- : data.workflowHealing || data.pendingReconciliation === true
+ : data.workflowHealing || data.pendingReconciliation === true || data.recipientConfirmation
? ''
: data.submitConfirmation
? 'form_confirmation'
@@ -10776,6 +10777,54 @@ function renderClarifyCard(data) {
return;
}
+ // Recipient confirmation: WebBrain asks whether a message may go to the
+ // person the open conversation shows. Fixed choices return stable values
+ // ('once'/'always'/'deny') with no free-text input, so nothing is parsed.
+ if (data.recipientConfirmation) {
+ card.dataset.recipientConfirmation = '1';
+ const confirmation = data.recipientConfirmation || {};
+ const recipients = (Array.isArray(confirmation.recipients) ? confirmation.recipients : [])
+ .map(item => ({ identity: String(item?.identity || '').slice(0, 240), role: String(item?.role || 'to').toLowerCase() }))
+ .filter(item => item.identity)
+ .slice(0, 16);
+ const recipient = recipients
+ .map(item => (item.role === 'cc' || item.role === 'bcc' ? `${item.identity} (${item.role.toUpperCase()})` : item.identity))
+ .join(', ') || String(data.question || '').slice(0, 240);
+ const requested = (Array.isArray(confirmation.requested) ? confirmation.requested : [])
+ .map(value => String(value || '').slice(0, 240)).filter(Boolean).join(', ');
+ const host = String(confirmation.host || '').slice(0, 300) || 'this site';
+ qEl.textContent = t('sp.recipient.question', { recipient });
+ const reasonEl = document.createElement('div');
+ reasonEl.className = 'clarify-reason';
+ reasonEl.textContent = requested
+ ? t('sp.recipient.reason_requested', { requested, recipient, host })
+ : t('sp.recipient.reason_open', { recipient, host });
+ card.appendChild(reasonEl);
+ const optionsEl = document.createElement('div');
+ optionsEl.className = 'clarify-options';
+ const choices = [
+ ['once', t('sp.recipient.send', { recipient })],
+ ...(confirmation.offerAll === true ? [['always', t('sp.recipient.send_all')]] : []),
+ ['deny', t('sp.recipient.dont_send')],
+ ];
+ for (const [value, label] of choices) {
+ const b = document.createElement('button');
+ b.type = 'button';
+ b.className = 'clarify-option';
+ b.textContent = String(label).slice(0, 300);
+ b.dataset.value = value;
+ b.addEventListener('click', () => {
+ card.dataset.answerLabel = b.textContent;
+ submitClarify(card, tabId, clarifyId, value, 'option');
+ });
+ optionsEl.appendChild(b);
+ }
+ card.appendChild(optionsEl);
+ content.appendChild(card);
+ scrollToBottom({ force: true });
+ return;
+ }
+
// Permission-prompt mode: localized question + fixed choices that
// return a stable VALUE ('once'/'always'/'deny'), and NO free-text input —
// so there's nothing to parse and no English/locale dependency.
@@ -11037,7 +11086,8 @@ function lockClarifyCardFromAuto(data) {
for (const card of document.querySelectorAll('.clarify-card')) {
if (String(card.dataset.clarifyId || '') !== clarifyId) continue;
if (card.classList.contains('clarify-answered')) return;
- if (card.dataset.permission === '1' || card.dataset.submitConfirmation === '1') return;
+ if (card.dataset.permission === '1' || card.dataset.submitConfirmation === '1'
+ || card.dataset.recipientConfirmation === '1') return;
clearClarifyCountdown(card);
card.classList.add('clarify-answered');
for (const el of card.querySelectorAll('button, input')) {
@@ -11408,7 +11458,7 @@ function submitClarify(card, tabId, clarifyId, answer, source) {
} else {
prefix = typeof t === 'function' ? t('sp.clarify.your_answer') : 'Your answer:';
}
- answered.textContent = `${prefix} ${answer}`;
+ answered.textContent = `${prefix} ${card.dataset.answerLabel || answer}`;
card.appendChild(answered);
placeAnsweredClarifyCardInTimeline(card);
scrollToBottom();
diff --git a/test/message-recipient-clarify-binding.mjs b/test/message-recipient-clarify-binding.mjs
index fc7e21850..f8cc134d6 100644
--- a/test/message-recipient-clarify-binding.mjs
+++ b/test/message-recipient-clarify-binding.mjs
@@ -1,12 +1,12 @@
#!/usr/bin/env node
// A user asked to send a photo to "gamze" on Instagram. The open conversation
-// was "Gamze Çömlekçi", so the recipient guard asked for confirmation, and the
-// user picked "Gamze Çömlekçi" twice. Both answers were discarded because the
-// model's question did not say "instead", and the run gave up. These cases run
-// the real content probe, guard, clarify tool and upload handler in both
-// builds: a question that shows the exact observed recipient binds the user's
-// pick, while refusals, vague replies and questions that hide the recipient
-// still authorize nothing.
+// was "Gamze Çömlekçi". The user picked "Gamze Çömlekçi" twice in the model's
+// questions, but the guard discarded both answers because the question did
+// not say "instead", and the run gave up. Now WebBrain itself asks once, on
+// its own card with fixed choices, whether the message may go to the person
+// the page shows; a model question that shows that name and gets it picked
+// still counts, and refusals never do. These cases run the real content
+// probe, guard, clarify tool, confirmation and upload handler in both builds.
import assert from 'node:assert/strict';
import { mkdtemp, readFile, writeFile, rm } from 'node:fs/promises';
import { tmpdir } from 'node:os';
@@ -105,6 +105,24 @@ async function setup(page, kind) {
const block = await agent._messageRecipientGuardBlock(71, 'upload_file', args, page.url(), context);
return { block, context };
};
+ // WebBrain's own card: answered with a fixed value, or left for Stop.
+ const confirm = async (block, choice, { allowPrompt = true, beforeAnswer = null } = {}) => {
+ const cards = [];
+ const context = {};
+ const rerun = () => agent._messageRecipientGuardBlock(71, 'upload_file', args, page.url(), context);
+ const result = await agent._resolveMessageRecipientConfirmation(71, block, (status, details) => {
+ if (status !== 'clarify') return;
+ cards.push(details);
+ const settle = async () => {
+ if (beforeAnswer) await beforeAnswer();
+ const entry = agent._pendingClarifications.get(71).get(details.clarifyId);
+ if (choice === null) agent._cancelClarifications(71, 'stopped');
+ else agent._settleClarification(entry, { answer: choice, source: 'option' });
+ };
+ void settle();
+ }, rerun, { allowPrompt });
+ return { result, cards, context };
+ };
// Shows one clarify card and answers it the way the user did.
const ask = async (clarifyArgs, answer, source = 'option') => {
const shown = [];
@@ -117,7 +135,7 @@ async function setup(page, kind) {
};
const state = () => page.evaluate(() => ({ inputs: window.inputEvents, changes: window.changeEvents,
count: document.querySelector('#file')?.files?.length || 0 }));
- return { agent, args, bind, ask, state };
+ return { agent, args, bind, ask, confirm, state };
}
const traceQuestions = [
@@ -142,10 +160,11 @@ for (const kind of ['chrome', 'firefox']) {
const first = await f.bind();
assert.equal(first.block?.reasonCode, 'active_recipient_unverified', JSON.stringify(first.block));
assert.equal(first.block.retryable, false);
+ assert.deepEqual(first.block.recipientConfirmation, { recipients: [{ identity: RECIPIENT, role: 'to' }],
+ requested: ['gamze'], host: 'www.instagram.com', offerAll: false });
assert.match(first.block.error, new RegExp(`"${RECIPIENT}"`));
assert.match(first.block.error, /named for this task \("gamze"\)/);
- assert.match(first.block.error, /clarify\(/);
- assert.doesNotMatch(first.block.error, /emails|treat it as authorized/);
+ assert.doesNotMatch(first.block.error, /clarify\(|emails|treat it as authorized/);
const { result, shown } = await f.ask(question, RECIPIENT);
assert.equal(shown.length, 1);
assert.deepEqual(result.recipientBinding, { required: true, bound: true }, JSON.stringify(result));
@@ -163,19 +182,19 @@ for (const kind of ['chrome', 'firefox']) {
for (const [label, question, answer, source, reason] of [
['a question that hides the recipient', { options: [RECIPIENT, 'Cancel'], question: 'Who should I send the photo to?' },
- RECIPIENT, 'option', /did not ask the user to approve sending to the recipient[\s\S]*Gamze Çömlekçi/],
+ RECIPIENT, 'option', /did not pick the recipient's exact name[\s\S]*its own confirmation \("Gamze Çömlekçi"\)/],
['a question about something else', { options: [RECIPIENT, 'No'], question: `Is ${RECIPIENT} your colleague?` },
- RECIPIENT, 'option', /did not ask the user to approve sending to the recipient/],
+ RECIPIENT, 'option', /approved nothing by itself[\s\S]*Do not ask about the recipient again/],
['a reply that does not pick the name', { options: [RECIPIENT, 'Cancel'], question: `Send it to ${RECIPIENT} instead?` },
- "you're on the right user", 'text', /did not choose the recipient[\s\S]*ask once more with the exact name[\s\S]*Gamze Çömlekçi/],
+ "you're on the right user", 'text', /did not pick the recipient's exact name[\s\S]*continue with the send: WebBrain shows the user its own confirmation \("Gamze Çömlekçi"\)/],
['a refusal that names the recipient', { options: [RECIPIENT, 'Cancel'], question: `Send it to ${RECIPIENT} instead?` },
- `No, not ${RECIPIENT}`, 'text', /declining or correcting/],
+ `No, not ${RECIPIENT}`, 'text', /declines or corrects[\s\S]*Do not send there/],
['a Turkish refusal that names the recipient', { options: [RECIPIENT, 'İptal'], question: `${RECIPIENT}'ye göndereyim mi?` },
- `Hayır, ${RECIPIENT} değil`, 'text', /declining or correcting/],
+ `Hayır, ${RECIPIENT} değil`, 'text', /declines or corrects/],
['a cancellation that says "all"', { options: [RECIPIENT, 'Send all remaining messages in this task without asking again', 'Cancel'],
- question: `Send it to ${RECIPIENT} instead?` }, 'Cancel all', 'text', /declining or correcting/],
+ question: `Send it to ${RECIPIENT} instead?` }, 'Cancel all', 'text', /declines or corrects/],
['an answer naming someone the page does not show', { options: [RECIPIENT, 'Cancel'], question: `Send it to ${RECIPIENT} instead?` },
- 'Gamze Yılmaz', 'text', /did not choose the recipient/],
+ 'Gamze Yılmaz', 'text', /did not pick the recipient's exact name/],
['a timed-out question', { options: [RECIPIENT, 'Cancel'], question: `Send it to ${RECIPIENT} instead?` },
RECIPIENT, 'timeout', /AUTO-SELECTED|auto-selected/],
]) {
@@ -259,6 +278,100 @@ for (const kind of ['chrome', 'firefox']) {
}
});
+ test('WebBrain asks once with its own card, and Send attaches the photo', async page => {
+ const f = await setup(page, kind);
+ const { block } = await f.bind();
+ const { result, cards, context } = await f.confirm(block, 'once');
+ assert.equal(result, null, JSON.stringify(result));
+ assert.equal(cards.length, 1);
+ assert.equal(cards[0].promptKind, 'recipientConfirmation');
+ assert.equal(cards[0].question, `Send to ${RECIPIENT}?`);
+ assert.deepEqual(cards[0].options, ['once', 'deny']);
+ assert.deepEqual(cards[0].recipientConfirmation.requested, ['gamze']);
+ assert.ok(context.messageRecipientDispatchBinding?.token);
+ const upload = await f.agent.executeTool(71, 'upload_file', f.args, null, context);
+ assert.equal(upload.success, true, JSON.stringify(upload));
+ assert.deepEqual(await f.state(), { inputs: 1, changes: 1, count: 1 });
+ // The same person is not asked about again in this task.
+ const again = await f.bind();
+ assert.equal(again.block, null, JSON.stringify(again.block));
+ });
+
+ test('Don\'t send blocks the send and is not asked again for the same person', async page => {
+ const f = await setup(page, kind);
+ const { block } = await f.bind();
+ const { result, cards, context } = await f.confirm(block, 'deny');
+ assert.equal(cards.length, 1);
+ assert.equal(result.reasonCode, 'recipient_declined', JSON.stringify(result));
+ assert.equal(result.noDispatch, true);
+ assert.match(result.error, /chose not to send to "Gamze Çömlekçi"[\s\S]*Do not retry/);
+ const upload = await f.agent.executeTool(71, 'upload_file', f.args, null, context);
+ assert.equal(upload.success, false);
+ const retry = await f.bind();
+ assert.equal(retry.block?.reasonCode, 'recipient_declined', JSON.stringify(retry.block));
+ assert.equal(retry.block.recipientConfirmation, undefined);
+ assert.deepEqual(await f.state(), { inputs: 0, changes: 0, count: 0 });
+ });
+
+ test('Stop while the card is open sends nothing', async page => {
+ const f = await setup(page, kind);
+ const { block } = await f.bind();
+ const { result } = await f.confirm(block, null);
+ assert.equal(result.cancelled, true, JSON.stringify(result));
+ assert.equal(result.recipientConfirmationCancelled, true);
+ assert.equal((await f.bind()).block?.reasonCode, 'active_recipient_unverified');
+ assert.deepEqual(await f.state(), { inputs: 0, changes: 0, count: 0 });
+ });
+
+ test('a conversation that changes while the card is open is not sent to', async page => {
+ const f = await setup(page, kind);
+ const { block } = await f.bind();
+ const { result, context } = await f.confirm(block, 'once', { beforeAnswer: () => page.evaluate(() => {
+ document.querySelector('#recipient').textContent = 'Gamze Yılmaz';
+ }) });
+ assert.equal(result.reasonCode, 'recipient_changed_during_confirmation', JSON.stringify(result));
+ assert.match(result.error, /changed to "Gamze Yılmaz"/);
+ assert.equal(context.messageRecipientDispatchBinding, undefined);
+ assert.deepEqual(await f.state(), { inputs: 0, changes: 0, count: 0 });
+ });
+
+ test('an unattended run is not asked and sends nothing', async page => {
+ const f = await setup(page, kind);
+ const { block } = await f.bind();
+ const { result, cards } = await f.confirm(block, 'once', { allowPrompt: false });
+ assert.equal(cards.length, 0);
+ assert.equal(result, block);
+ assert.match(result.error, /user has not confirmed it, so nothing was sent/);
+ });
+
+ test('a task with several recipients can approve the remaining sends at once', async page => {
+ const f = await setup(page, kind);
+ f.agent._planExecutionGuards.get(71).messaging = { target_kind: 'named',
+ recipients: [{ identity: 'gamze', role: 'to' }, { identity: 'ali', role: 'to' }] };
+ const { block } = await f.bind();
+ assert.equal(block.recipientConfirmation.offerAll, true);
+ const { result, cards } = await f.confirm(block, 'always');
+ assert.deepEqual(cards[0].options, ['once', 'always', 'deny']);
+ assert.equal(result, null, JSON.stringify(result));
+ assert.equal(f.agent._planExecutionGuards.get(71).messageRecipientApprovedAll, true);
+ });
+
+ test('"always" is ignored where it was not offered', async page => {
+ const f = await setup(page, kind);
+ const { block } = await f.bind();
+ const { result } = await f.confirm(block, 'always');
+ assert.equal(result.reasonCode, 'recipient_declined', JSON.stringify(result));
+ assert.equal(f.agent._planExecutionGuards.get(71).messageRecipientApprovedAll, undefined);
+ });
+
+ test('a plan that does not send messages never offers the card', async page => {
+ const f = await setup(page, kind);
+ f.agent._planExecutionGuards.get(71).requiresSubmission = false;
+ const { block } = await f.bind();
+ assert.equal(block?.noDispatch, true, JSON.stringify(block));
+ assert.equal(block.recipientConfirmation, undefined);
+ });
+
// The model clicked the composer's icon buttons while the send was blocked.
// Attachment and picker launchers are not sends; Like and Send stay guarded.
for (const [control, nonSend] of [['attach', true], ['titled', true], ['like', false], ['send-icon', false],
diff --git a/test/quality/recipient-clarify-mv3.mjs b/test/quality/recipient-clarify-mv3.mjs
index 36c3f7be9..f23b0785d 100644
--- a/test/quality/recipient-clarify-mv3.mjs
+++ b/test/quality/recipient-clarify-mv3.mjs
@@ -7,28 +7,32 @@ import { chromium } from 'playwright';
import { conformFixtureCompletionCall } from './completion-provider-contract.mjs';
// The reported trace through the installed MV3 extension: the user asks to
-// send a photo to "gamze", the open direct thread is "Gamze Çömlekçi", the
-// recipient guard blocks the attachment and asks once, the user picks that
-// exact name, and the attachment is sent once. A second variant answers with
-// a refusal that names the recipient, which must send nothing. The thread,
-// photo and model are owned local fixtures; nothing leaves the host.
+// send a photo to "gamze", and the open direct thread is "Gamze Çömlekçi".
+// WebBrain asks once on its own card and the photo is sent once when the user
+// picks Send; Don't send sends nothing. A model question that shows the exact
+// name and gets it picked also counts (one question in total), and a typed
+// refusal never does. The thread, photo and model are owned local fixtures;
+// nothing leaves the host.
const threadUrl = 'https://www.instagram.com/direct/t/17848282661759097/';
const recipient = 'Gamze Çömlekçi';
const question = `Send the photo to ${recipient} on Instagram?`;
const selector = 'input[type="file"][accept="audio/*,.mp4,.mov,.png,.jpg,.jpeg"][multiple]';
const png = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+aS3kAAAAASUVORK5CYII=', 'base64');
-// Default settings advertise clarify without `purpose`; the trace's settings
-// (research escalation on) advertise it, and that model declared it.
-for (const [variant, answer, source, declared] of [['approved', recipient, 'option', false],
- ['approved-declared-purpose', recipient, 'option', true], ['refused', `No, not ${recipient}`, 'user', false]]) {
- await runVariant(variant, answer, source, declared);
-}
+// [variant, model steps, model-question answer, its source, card answer, sends expected]
+const variants = [
+ ['card-send', ['download', 'list', 'upload', 'tree', 'done'], null, null, 'once', 1],
+ ['card-dont-send', ['download', 'list', 'upload', 'done'], null, null, 'deny', 0],
+ ['model-asks-first', ['download', 'list', 'clarify', 'upload', 'tree', 'done'], recipient, 'option', null, 1],
+ ['typed-refusal', ['download', 'list', 'clarify', 'upload', 'done'], `No, not ${recipient}`, 'user', 'deny', 0],
+];
+for (const variant of variants) await runVariant(...variant);
-async function runVariant(variant, answer, source, declared) {
- const approved = variant.startsWith('approved');
+async function runVariant(variant, steps, answer, source, cardAnswer, expectedSends) {
+ const approved = expectedSends > 0;
const out = path.resolve(process.env.WEBBRAIN_QUALITY_ARTIFACTS
- || `ci/artifacts/quality-audit-2026-10-07/recipient-clarify-mv3/${variant}`);
+ ? path.join(process.env.WEBBRAIN_QUALITY_ARTIFACTS, variant)
+ : `ci/artifacts/quality-audit-2026-10-07/recipient-clarify-mv3/${variant}`);
await fs.mkdir(out, { recursive: true });
const intent = { request_kind: 'execute', scope_relation: 'new', requires_state_change: true, requires_submission: true,
messaging: { target_kind: 'named', recipients: [{ identity: 'gamze', role: 'to' }] },
@@ -36,7 +40,7 @@ async function runVariant(variant, answer, source, declared) {
allows_planner_shaped_result: false, allows_app_state_tool_evidence: false, read_scope: 'visible_page',
summary: 'Attach the downloaded photo in the Gamze conversation.', steps: [{ id: '1', action: 'Attach the photo and verify it was sent.' }],
memory: { use_progress_ledger: false, progress_action: null }, scheduling: null, risks: [] };
- const sends = [], providerRequests = [], clarifications = [];
+ const sends = [], providerRequests = [], clarifications = [], cards = [];
let actionCalls = 0, judgeCalls = 0, blockedRemote = 0, base = '';
const completionRecovery = { reads: 0 };
const textOf = content => typeof content === 'string' ? content : Array.isArray(content)
@@ -53,9 +57,6 @@ async function runVariant(variant, answer, source, declared) {
}
return undefined;
};
- const steps = approved
- ? ['download', 'list', 'upload', 'clarify', 'upload', 'tree', 'done']
- : ['download', 'list', 'upload', 'clarify', 'upload', 'done'];
const server = http.createServer(async (request, response) => {
if (request.url === '/photo.png') {
response.writeHead(200, { 'Content-Type': 'image/png', 'Content-Length': png.length,
@@ -79,8 +80,7 @@ async function runVariant(variant, answer, source, declared) {
const call = kind === 'download' ? { name: 'download_files', args: { urls: [`${base}/photo.png`] } }
: kind === 'list' ? { name: 'list_downloads', args: { limit: 5 } }
: kind === 'upload' ? { name: 'upload_file', args: { selector, downloadId: downloadIdIn(input) } }
- : kind === 'clarify' ? { name: 'clarify', args: { options: [recipient, 'Cancel'], question,
- ...(declared ? { purpose: 'message_recipient' } : {}) } }
+ : kind === 'clarify' ? { name: 'clarify', args: { options: [recipient, 'Cancel'], question } }
: kind === 'tree' ? { name: 'get_accessibility_tree', args: { filter: 'all' } }
: { name: 'done', args: approved
? { outcome: 'success', summary: `Sent the photo to ${recipient}.` }
@@ -160,7 +160,6 @@ async function runVariant(variant, answer, source, declared) {
autoScreenshot: false, screenshotFallback: false, planBeforeActMode: 'off', planBeforeAct: false,
planReviewMode: 'never', maxAgentSteps: 14, systemOneEnabled: false, agentAllowLocalNetwork: true,
askBeforeConsequentialActions: false, openaiAskStreamingEnabled: false }));
- if (declared) await harness.evaluate(() => chrome.storage.local.set({ researchEscalationEnabled: true }));
assert.equal((await message('update_provider', { providerId: 'openrouter', config: { apiKey: 'owned-fixture-fake-key',
baseUrl: `${base}/v1`, model: 'minimax/minimax-m3', enabled: true,
contextWindow: 1000000, supportsAskStreaming: false } })).ok, true);
@@ -168,14 +167,21 @@ async function runVariant(variant, answer, source, declared) {
await worker.evaluate(() => { recipientFixtureAgent.clarifyTimeoutSec = -1; });
const page = await context.newPage(); await page.goto(threadUrl);
const tabId = await harness.evaluate(async url => (await chrome.tabs.query({})).find(tab => tab.url === url)?.id, threadUrl);
- // Answer each clarification card the way the user did in the trace.
+ // Answer the model's question the way the user did, and WebBrain's card
+ // with the variant's choice.
let answering = true;
+ const answered = new Set();
const answerer = (async () => {
while (answering) {
const pending = await worker.evaluate(tabId => [...(recipientFixtureAgent._pendingClarifications.get(tabId)?.keys() || [])], tabId);
for (const clarifyId of pending) {
- clarifications.push(clarifyId);
- assert.equal((await message('clarify_response', { tabId, clarifyId, answer, source })).ok, true);
+ if (answered.has(clarifyId)) continue;
+ answered.add(clarifyId);
+ const card = clarifyId.startsWith('recipient_');
+ (card ? cards : clarifications).push(clarifyId);
+ const reply = card ? { answer: cardAnswer, source: 'option' } : { answer, source };
+ assert.ok(reply.answer, `Unexpected ${card ? 'card' : 'question'} in ${variant}`);
+ assert.equal((await message('clarify_response', { tabId, clarifyId, ...reply })).ok, true);
}
await new Promise(resolve => setTimeout(resolve, 100));
}
@@ -187,28 +193,39 @@ async function runVariant(variant, answer, source, declared) {
success: event.data?.result?.success, reasonCode: event.data?.result?.reasonCode || null,
recipientBinding: event.data?.result?.recipientBinding || null, note: event.data?.result?.note || null,
error: event.data?.result?.error || null }));
- const questions = result.updates.filter(event => event.type === 'clarify').map(event => event.data?.question);
- await fs.writeFile(path.join(out, 'evidence.json'), JSON.stringify({ toolResults, questions, clarifications, sends,
+ const prompts = result.updates.filter(event => event.type === 'clarify').map(event => ({ kind: event.data?.promptKind,
+ question: event.data?.question, recipientConfirmation: event.data?.recipientConfirmation || null }));
+ await fs.writeFile(path.join(out, 'evidence.json'), JSON.stringify({ toolResults, prompts, clarifications, cards, sends,
judgeCalls, blockedRemote }, null, 2));
const uploads = toolResults.filter(item => item.name === 'upload_file');
- assert.equal(uploads[0]?.reasonCode, 'active_recipient_unverified', JSON.stringify(toolResults));
- assert.equal(clarifications.length, 1, `Exactly one question: ${JSON.stringify(toolResults)}`);
- const clarify = toolResults.find(item => item.name === 'clarify');
+ assert.equal(sends.length, expectedSends, `Sends: ${JSON.stringify(toolResults)}`);
+ assert.equal(await page.locator('[data-message-direction="outgoing"]').count(), expectedSends);
+ assert.equal(clarifications.length + cards.length, steps.includes('clarify') && cardAnswer ? 2 : 1,
+ `One question, except after a refusal: ${JSON.stringify(prompts)}`);
+ if (cards.length) {
+ const card = prompts.find(item => item.kind === 'recipientConfirmation');
+ assert.deepEqual(card.recipientConfirmation, { recipients: [{ identity: recipient, role: 'to' }],
+ requested: ['gamze'], host: 'www.instagram.com', offerAll: false });
+ assert.equal(card.question, `Send to ${recipient}?`);
+ }
if (approved) {
- assert.deepEqual(clarify?.recipientBinding, { required: true, bound: true }, JSON.stringify(clarify));
- assert.equal(uploads[1]?.success, true, JSON.stringify(uploads[1]));
+ assert.equal(uploads.length, 1, JSON.stringify(uploads));
+ assert.equal(uploads[0].success, true, JSON.stringify(uploads[0]));
assert.deepEqual(sends, [{ method: 'POST', path: '/api/v1/direct_v2/threads/17848282661759097/items/configure_photo/', containsPhoto: true }]);
- assert.equal(await page.locator('[data-message-direction="outgoing"]').count(), 1);
+ if (clarifications.length) {
+ const clarify = toolResults.find(item => item.name === 'clarify');
+ assert.deepEqual(clarify?.recipientBinding, { required: true, bound: true }, JSON.stringify(clarify));
+ }
} else {
- assert.equal(clarify?.recipientBinding?.bound, false, JSON.stringify(clarify));
- assert.match(clarify?.note || '', /declining or correcting/);
- assert.equal(uploads[1]?.reasonCode, 'active_recipient_unverified', JSON.stringify(uploads[1]));
- assert.deepEqual(sends, []);
- assert.equal(await page.locator('[data-message-direction="outgoing"]').count(), 0);
+ assert.equal(uploads.at(-1)?.reasonCode, 'recipient_declined', JSON.stringify(uploads));
+ if (clarifications.length) {
+ const clarify = toolResults.find(item => item.name === 'clarify');
+ assert.equal(clarify?.recipientBinding?.bound, false, JSON.stringify(clarify));
+ }
}
- assert.match(uploads[0].error, /"Gamze Çömlekçi", which is not exactly the recipient named for this task \("gamze"\)/);
console.log(JSON.stringify({ passed: true, installedMV3: true, variant, questions: clarifications.length,
- sends: sends.length, uploads: uploads.map(item => item.success === true ? 'sent' : item.reasonCode), judgeCalls, blockedRemote }));
+ cards: cards.length, sends: sends.length, uploads: uploads.map(item => item.success === true ? 'sent' : item.reasonCode),
+ judgeCalls, blockedRemote }));
} finally {
await context?.close(); await new Promise(resolve => server.close(resolve));
const resolved = path.resolve(profile);
diff --git a/test/recipient-confirmation-ui.mjs b/test/recipient-confirmation-ui.mjs
new file mode 100644
index 000000000..4419bb3b4
--- /dev/null
+++ b/test/recipient-confirmation-ui.mjs
@@ -0,0 +1,136 @@
+// WebBrain's own recipient confirmation card in the side panel of both
+// builds: the real renderClarifyCard and submitClarify run in Chromium and
+// Firefox with the real locale strings. The card names the person the open
+// conversation shows, offers fixed choices only (no free text to interpret),
+// sends a stable value back, never times out, and records no memory.
+import assert from 'node:assert/strict';
+import fs from 'node:fs';
+import { test } from 'node:test';
+import { chromium, firefox } from 'playwright';
+
+const read = (build, file) => fs.readFileSync(new URL(`../src/${build}/${file}`, import.meta.url), 'utf8').replace(/\r\n/g, '\n');
+function extract(source, name) {
+ const start = source.search(new RegExp(`^(?:async )?function ${name}\\(`, 'm'));
+ assert.ok(start >= 0, `Missing function: ${name}`);
+ return source.slice(start, source.indexOf('\n}', start) + 2);
+}
+
+async function panel(build, engine, locale) {
+ const source = read(build, 'src/ui/sidepanel.js');
+ const strings = (await import(`../src/${build}/src/ui/locales/${locale}.js`)).default;
+ const english = (await import(`../src/${build}/src/ui/locales/en.js`)).default;
+ const browser = await engine.launch({ headless: true });
+ const page = await browser.newPage({ viewport: { width: 380, height: 700 } });
+ await page.setContent(`<style>${read(build, 'styles/sidepanel.css')}</style>
+ <div class="message assistant" data-run-request-id="request-1"><div class="message-content"></div></div>`);
+ await page.addScriptTag({ content: `(() => {
+ const STRINGS = ${JSON.stringify({ ...english, ...strings })};
+ const t = (key, params) => String(STRINGS[key] ?? key).replace(/\\{(\\w+)\\}/g, (_, name) => params?.[name] ?? '{' + name + '}');
+ let currentTabId = 9;
+ let currentAssistantEl = document.querySelector('.message.assistant');
+ const submittedClarificationIds = new Set();
+ const sent = [];
+ function clarificationSubmissionKey(tabId, requestId, clarifyId) { return JSON.stringify([Number(tabId), String(requestId || ''), String(clarifyId || '')]); }
+ function hideActivity() {} function playClarifySound() {} function scrollToBottom() {} function hideRecommendedActions() {}
+ function resetChatNavigation() {} function addMessage() { return currentAssistantEl; } function applyClarifyTimeoutExtension() {}
+ function clearClarifyCountdown() {} function placeAnsweredClarifyCardInTimeline() {} function startClarifyCountdown() { sent.push(['countdown']); }
+ function maybeShowPermissionEducationHint() {} function workflowHealingTargetLabel(value) { return String(value || ''); }
+ function sameTabId(a, b) { return Number(a) === Number(b); } function restoreActiveRunState() {}
+ const CAPABILITY_LABEL = {};
+ async function sendToBackground(action, payload) { sent.push([action, payload]); return { matched: true }; }
+ ${extract(source, 'renderClarifyCard')}
+ ${extract(source, 'submitClarify')}
+ window.panel = { render: renderClarifyCard, sent };
+ })();` });
+ return { browser, page };
+}
+
+const card = (extra = {}) => ({ clarifyId: 'recipient_card', tabId: 9, promptKind: 'recipientConfirmation',
+ question: 'Send to Gamze Çömlekçi?', options: ['once', 'deny'],
+ recipientConfirmation: { recipients: [{ identity: 'Gamze Çömlekçi', role: 'to' }], requested: ['gamze'],
+ host: 'www.instagram.com', offerAll: false }, ...extra });
+
+for (const [build, engine] of [['chrome', chromium], ['firefox', firefox]]) {
+ test(`${build}: the card names both people and sends a fixed value`, async () => {
+ const { browser, page } = await panel(build, engine, 'en');
+ try {
+ await page.evaluate(data => window.panel.render(data), card());
+ const view = await page.evaluate(() => {
+ const element = document.querySelector('.clarify-card');
+ return { question: element.querySelector('.clarify-question').textContent,
+ reason: element.querySelector('.clarify-reason').textContent,
+ buttons: [...element.querySelectorAll('.clarify-option')].map(button => [button.dataset.value, button.textContent]),
+ input: !!element.querySelector('input, textarea'), memory: element.dataset.memorySource,
+ flag: element.dataset.recipientConfirmation };
+ });
+ assert.equal(view.question, 'Send to Gamze Çömlekçi?');
+ assert.equal(view.reason, 'Your request named “gamze”. The open conversation on www.instagram.com is with Gamze Çömlekçi.');
+ assert.deepEqual(view.buttons, [['once', 'Send to Gamze Çömlekçi'], ['deny', 'Don’t send']]);
+ assert.equal(view.input, false, 'no free text to interpret');
+ assert.equal(view.memory, '', 'a recipient choice is not saved to memory');
+ assert.equal(view.flag, '1');
+ await page.click('button[data-value="once"]');
+ const after = await page.evaluate(() => ({ sent: window.panel.sent,
+ answered: document.querySelector('.clarify-your-answer')?.textContent,
+ disabled: [...document.querySelectorAll('.clarify-option')].every(button => button.disabled) }));
+ assert.deepEqual(after.sent, [['clarify_response', { tabId: 9, clarifyId: 'recipient_card', answer: 'once', source: 'option' }]]);
+ assert.equal(after.answered, 'Your answer: Send to Gamze Çömlekçi');
+ assert.equal(after.disabled, true);
+ } finally { await browser.close(); }
+ });
+
+ test(`${build}: Turkish card, the remaining-sends choice, and copy roles`, async () => {
+ const { browser, page } = await panel(build, engine, 'tr');
+ try {
+ await page.evaluate(data => window.panel.render(data), card({ options: ['once', 'always', 'deny'],
+ recipientConfirmation: { recipients: [{ identity: '[email protected]', role: 'to' }, { identity: '[email protected]', role: 'cc' }],
+ requested: [], host: 'mail.example.com', offerAll: true } }));
+ const view = await page.evaluate(() => ({
+ question: document.querySelector('.clarify-question').textContent,
+ reason: document.querySelector('.clarify-reason').textContent,
+ buttons: [...document.querySelectorAll('.clarify-option')].map(button => [button.dataset.value, button.textContent]) }));
+ assert.equal(view.question, '[email protected], [email protected] (CC) adlı kişiye gönderilsin mi?');
+ assert.equal(view.reason, 'mail.example.com üzerinde açık olan sohbet: [email protected], [email protected] (CC).');
+ assert.deepEqual(view.buttons.map(([value]) => value), ['once', 'always', 'deny']);
+ assert.equal(view.buttons[1][1], 'Gönder, bu görevde bir daha sorma');
+ await page.click('button[data-value="deny"]');
+ assert.deepEqual(await page.evaluate(() => window.panel.sent.map(([action, payload]) => [action, payload.answer])),
+ [['clarify_response', 'deny']]);
+ } finally { await browser.close(); }
+ });
+
+ test(`${build}: page text in the card is shown as text, never as markup`, async () => {
+ const { browser, page } = await panel(build, engine, 'en');
+ try {
+ await page.evaluate(data => window.panel.render(data), card({ recipientConfirmation: {
+ recipients: [{ identity: '<img src=x onerror="window.injected=1">Mallory', role: 'to' }],
+ requested: ['<b>gamze</b>'], host: 'www.instagram.com', offerAll: false } }));
+ const view = await page.evaluate(() => ({ images: document.querySelectorAll('.clarify-card img').length,
+ injected: window.injected === 1, question: document.querySelector('.clarify-question').textContent }));
+ assert.equal(view.images, 0);
+ assert.equal(view.injected, false);
+ assert.match(view.question, /<img src=x/);
+ } finally { await browser.close(); }
+ });
+}
+
+test('every locale of both builds translates the card', async () => {
+ const keys = ['sp.recipient.question', 'sp.recipient.reason_requested', 'sp.recipient.reason_open',
+ 'sp.recipient.send', 'sp.recipient.send_all', 'sp.recipient.dont_send'];
+ for (const build of ['chrome', 'firefox']) {
+ const directory = new URL(`../src/${build}/src/ui/locales/`, import.meta.url);
+ const locales = fs.readdirSync(directory).filter(name => /^[a-z]{2}\.js$/.test(name));
+ assert.equal(locales.length, 23, `${build}: locale count`);
+ for (const file of locales) {
+ const strings = (await import(new URL(file, directory))).default;
+ for (const key of keys) {
+ assert.equal(typeof strings[key], 'string', `${build}/${file}: ${key}`);
+ for (const name of ['{recipient}'].concat(key.includes('reason') ? ['{host}'] : [])) {
+ assert.ok(strings[key].includes(name) || ['sp.recipient.send_all', 'sp.recipient.dont_send'].includes(key),
+ `${build}/${file}: ${key} lacks ${name}`);
+ }
+ }
+ assert.ok(strings['sp.recipient.reason_requested'].includes('{requested}'), `${build}/${file}: requested name`);
+ }
+ }
+});
diff --git a/test/run.js b/test/run.js
index f81cbd430..0b721d663 100644
--- a/test/run.js
+++ b/test/run.js
@@ -54367,8 +54367,8 @@ test('sidepanel long replies use reading-first turn navigation', () => {
);
assert.equal(
(clarifySource.match(/scrollToBottom\(\{ force: true \}\);/g) || []).length,
- 4,
- `${label}: workflow healing, submit, permission, and clarify prompts should override reading-first scroll suppression`,
+ 5,
+ `${label}: workflow healing, submit, recipient, permission, and clarify prompts should override reading-first scroll suppression`,
);
assert.match(
panel,