Repository navigation
feat(browser): surface observed dialogs - #83099
Conversation
|
Codex review: found issues before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. from source inspection: PR head 8530d2f returns Real behavior proof Mantis proof suggestion Next step before merge Security Review findings
Review detailsBest possible solution: Keep the dialog observability feature, but gate blocked Do we have a high-confidence way to reproduce the issue? Yes, from source inspection: PR head 8530d2f returns Is this the best way to solve the issue? No. Surfacing observed dialogs is a reasonable feature, but the action response must fail closed or redact dialog state through current-URL policy before this is the maintainable solution. Full review comments:
Overall correctness: patch is incorrect Security concerns:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 57da466ecbb5. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f9532dc686
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (result.blockedByDialog) { | ||
| return await jsonOk({ | ||
| blockedByDialog: true, | ||
| browserState: result.browserState, |
There was a problem hiding this comment.
Guard blocked-dialog act responses with URL policy
When executeActViaPlaywright reports blockedByDialog, this branch returns browserState directly even though /act does not enforce enforceCurrentUrlAllowed. In environments with SSRF/navigation policy enabled, a request against a disallowed current tab URL can still return dialog text from that page via browserState.dialogs.pending, which leaks blocked-page content that snapshot/debug routes explicitly guard against.
Useful? React with 👍 / 👎.
f9532dc to
8530d2f
Compare
|
Landed in 7afac60. Verification:
Known proof gap: no live Chrome UI session; Testbox wrapper was unavailable for this checkout before local/CI proof. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8530d2f26b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const dialogAbort = createObservedDialogAbortSignalForPage({ | ||
| page, | ||
| parentSignal: opts.signal, | ||
| }); |
There was a problem hiding this comment.
Let close actions bypass dialog-block abort signal
executeActViaPlaywright now wraps all actions with createObservedDialogAbortSignalForPage, which aborts immediately when any pending dialog exists. That means act with kind: "close" never reaches closePageViaPlaywright and instead returns blockedByDialog, so a tab can get stuck in a modal state with no /act close recovery path (notably the tool uses /act close when no targetId is provided). Please bypass the dialog abort guard for close (or run close before installing that signal) so users can always dismiss a wedged tab.
Useful? React with 👍 / 👎.
Summary
Verification
node scripts/run-vitest.mjs extensions/browser/src/browser-tool.test.ts extensions/browser/src/browser/pw-session.dialogs.test.ts extensions/browser/src/browser/pw-tools-core.interactions.evaluate.abort.test.ts extensions/browser/src/browser/server.agent-contract-core.test.ts extensions/browser/src/browser/server.agent-contract-form-layout-act-commands.test.ts extensions/browser/src/browser/routes/agent.existing-session.test.tsnode scripts/run-vitest.mjs extensions/browser/src/browser/client.test.ts extensions/browser/src/browser-tool.test.ts extensions/browser/src/browser/pw-session.dialogs.test.ts extensions/browser/src/browser/server.agent-contract-core.test.tsgit diff --checkenv CI=1 NODE_OPTIONS=--max-old-space-size=4096 OPENCLAW_TEST_PROJECTS_PARALLEL=6 OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=900000 pnpm check:changed/Users/steipete/Projects/agent-scripts/skills/codex-review/scripts/codex-reviewBehavior addressed: Managed browser actions and snapshots now expose pending modal dialog state, and dialog actions can target a still-pending dialog id.
Real environment tested: local browser test harness and local changed gate in this checkout
Exact steps or command run after this patch: see Verification
Evidence after fix: focused dialog/control-server/browser-tool tests passed;
pnpm check:changedpassed for extensions, extensionTests, and docs lanes; Codex review reported no actionable findingsObserved result after fix: action-triggered dialogs return
blockedByDialogwith pending ids, pending dialog text is URL-policy guarded, unsupported existing-session dialog ids fail closed, and blocked AI snapshots preserve recovery stateWhat was not tested: live Chrome UI session; Blacksmith Testbox changed gate was blocked because the configured hydrate workflow has no testbox step, and AWS fallback was a raw box without
pnpm