Repository navigation
fix(engine): always ask before browser tools on the built-in harness - #4422
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The docs and the Settings footer promise that every browser action asks for approval. That held for external harnesses (the MCP path always shows a card), but not on the built-in harness:
authorize_tool_with_argsreturnedAllowwheneverauto_confirmwas set, and the ACP, TUI and headless policies returned early under auto-approve.Network, soallowed_in_plan_modelet the agent click and type into live sites.Changes:
tools::always_asks(the browser tools) makesauthorize_tool_with_argsignoreauto_confirmfor them.bypass_confirmationstill means "this call was already approved": the executor passes it after the card was answered, so it keeps working.AcpPolicy(desktop app),InteractivePolicy(TUI) and the per-call path ask for browser calls under auto-approve and skip the card for other calls as before.HeadlessPolicyrefuses them, since nobody can answer.browser_open,browser_clickandbrowser_type;browser_readandbrowser_screenshotstay available and ask.Note on the issue's first criterion: it named
bypass=true → RequireConfirmation. In the engine,bypass_confirmationis the flag for "already approved", so forcing a card there would ask twice or block execution. Auto-approve (auto_confirm) is what no longer skips it.Changelog
Fixed: browser tools on the built-in harness ask before every action even with auto-approve on, and Plan mode no longer lets them click or type.
Testing
tools/tests/browser_approval.rs: auto-approve still asks for every browser tool; an approval already given runs it; other tools are unchanged; Plan mode denies open/click/type and asks for read/screenshot. CI runs them.cargo fmt --all -- --check,scripts/check-comments.py,scripts/check-rust-size.py.Closes #4363