Skip to content

feat(browser): wire experimental.browser v4 runtime, session isolation, nav/tabs, and reading executors - #287

Merged
Hona merged 4 commits into
devfrom
browser-tools/pr2-rpc-nav-read
Nov 20, 2026
Merged

Hona merged 4 commits into
devfrom
browser-tools/pr2-rpc-nav-read

Conversation

@Hona

@Hona Hona commented Nov 20, 2026

Copy link
Copy Markdown
Member

Summary

Wires the pure-Rust experimental.browser v4 runtime into apps/desktop (StateSlots, zero struct App fields, zero contract.json edits, zero idle Luau VM wakeups) with strict per-session tab_<uuid> isolation and the Navigation/Tabs, Reading, Diagnostics, Screenshot, and Files list/get executor families (WS-1 Phase 4 PR 2).

  • crates/browser-pane/src/tools/:
    • snapshot/{mod,format}.rs: deep accessibility tree walker & formatter matching snapshot.ts (landmark priority buckets, 25% reading budget, editable-subtree privacy boundary, fail-closed value=<hidden> redaction, ref preservation, truncation footer).
    • field_value.rs: exact field-value.ts sensitive form field classifier (type="password|file", -webkit-text-security, maxLength == 1 OTP/PIN, secret autocomplete tokens, camel/word-normalized secret labels & adjacent show-password toggle buttons).
    • frames.rs: Page.getFrameTree parser filtering out extension_origin frames and subtrees.
    • diagnostics.rs: bounded per-tab console & network store excluding extension sources and redacting cookie/set-cookie/authorization/proxy-authorization headers to <redacted>.
    • keys.rs: agent chord parser & clipboard/context-menu refusal guard.
    • client.rs: bounded CdpEvent ring + drain_cdp_events / has_cdp_events.
  • crates/opencode-kit/src/client/browser_rpc/machine.rs: fixes the cold-location PRE-08 race where plugin.updated arrives while AttachState::Connecting is already in flight before AttachEnded(Unavailable) returns.
  • apps/desktop/src/surfaces/browser/rpc/:
    • mod.rs & session.rs: BrowserRpcFeature (StateSlots), SSE lifecycle hooks (server.connected, plugin.updated, rpc.experimental.browser.control, session.{created,moved,deleted}), per-session bijective tab_<uuid> <-> host_id isolation, ordered FIFO outbound state+result worker, fail-closed Blocked::RemoteUnproxied for remote servers until PR 4 wires WS-1 #277's remote proxy context.
    • exec/{mod,nav,snapshot,read,capture}.rs: non-blocking executors for tabs.{list,open,focus,close}, navigate, back, forward, reload (ignoreCache), stop, preview, navigate.path, frames, snapshot, find, evaluate (page & ref w/ isConnected guard), wait (load|url|text|textGone|delay), screenshot (viewport/ref/fullPage + maxWidth downscale), console, network.{list,get}, files.{list,get}, and metadata-only inspect: true. Enforces dialog ([browser.dialog_open]/[browser.dialog_interrupted]), HTTP auth (sign_in_required), URL policy, and extension-origin safeguards.
  • Keeps existing rune_mcp untouched until PR 4 so no server loses working tools in the interim.

Proof

Driven end-to-end in proof/browser-tools/pr2/summary.json against live opencode-ref @ e51247f626, live opencode-desktop.exe, and real CEF 156.0.26 OSR using scripted model turns (OPENCODE_DRIVE [[rune-script]], no paid model):

  • Two concurrent sessions in the same window / BrowserHost: both attached simultaneously (attachedA: true, attachedB: true), proving live cold-location PRE-08 recovery.
  • Navigation & Reading families: tabs.open, tabs.list, frames (2 frames), snapshot, find, evaluate ("Form Page:4"), screenshot (PNG transferred to server), files.list, files.get, navigate, wait(url), wait(text), wait(miss) (met: false), reload(ignoreCache: true) (reloadHits: 2), back, forward, tabs.open({ path: "report.html" }), tabs.open({ path: "notes.txt" }) (shown: "file"), tabs.close.
  • Safeguards: 6/6 sensitive-field redaction checks (username visible; password, one-time-code, API Key, 1-char PIN, and toggled-password all value=<hidden>); chrome-extension:// refused; Session B sees 0 of Session A's tabs and is denied snapshot, evaluate, and tabs.close on Session A's tabID.
  • Checks: scripts/guardrails.ps1 (5/5), cargo check -p browser-pane --no-default-features, cargo clippy --no-deps -p browser-pane -- -D warnings, cargo check --workspace (0 warnings), scripts/web.ps1 -Check (1026 files in 47 crates).

@Hona
Hona merged commit a974a66 into dev Nov 20, 2026
6 checks passed
@Hona
Hona deleted the browser-tools/pr2-rpc-nav-read branch November 20, 2026 12:26
@github-actions

github-actions Bot commented Nov 20, 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 added a commit that referenced this pull request Nov 20, 2026
…18..UP-122 (#295)

- Fold verified fleet PRs #278, #285, #287, #288, #289, #290, #291, and
  #293 (Rune dc8f7f72: #1301, #1302 focus rescue verified Send+Enter -> effort)
  into docs/upstream-sync/ledger.{json,md}
- Close UP-062 packaged-default regression (#278), UP-095-UI / UP-100 /
  UP-106 / UP-109 / UP-117 (#285, #289), and PRE-08 (#287); reassign
  UP-115, UP-116, UP-075 to BROWSER-UI
- Add separate Reviewed column for browser rows tracking retrospective
  security reviews on merged PRs (#245, #268, #272, #277, #288, #275, #287,
  #285, #289) and pre-merge holds (#274, #280, #281, #283, #286, #292, #294,
  and BROWSER-TOOLS PR 3+)
- Audit upstream anomalyco/opencode bfee96a859..2002222d13 (+6 commits:
  1 skipped, 5 added: UP-118..UP-122) and refine radar routing
Hona added a commit that referenced this pull request Nov 20, 2026
…304)

- Fold verified merged PRs #280 (WS-9 crates/browser-extensions, confirmed),
  #281 (PREVIEWS oc-preview:// + ContextPool::is_tab_ready, confirmed third
  read + merge check), #297 (inline chat video + reply link menu, not
  reviewed before merge), #299 (WS-1 close_all_connections crash fix), and
  #300 (Rune eff95e80: #1304 roving-group rescue + #1291 monochrome SMIL
  animated icons completing UP-069 / WS-6)
- Update browser Reviewed column and note #287 eager-attach time_updated
  regression on UP-095-TOOLS
- Audit upstream anomalyco/opencode 2002222d13..fe8def6854 (+19 commits:
  7 skipped, 12 added: UP-123..UP-134)
Hona added a commit that referenced this pull request Nov 20, 2026
- Fold security-confirmed merged PRs #292 (6d7a6ed, WS-1 mandatory
  RemoteServer proxy), #294 (ae3e910, BROWSER-UI file-link/click-to-run
  fix with known symlink/junction root limitation), and #274 (5da6474,
  WS-9 engine MV3 extension host, inert without --extension flags)
- Update browser Reviewed column: #301 in rework (#287 eager-attach
  time_updated regression still live on dev), #296/#298/#302/#303/#305/#306
  in rework, #307 open for pre-merge security review
- Audit upstream anomalyco/opencode fe8def6854..4122af0206 (+2 commits:
  1 skipped #65255 core/codemode, 1 added UP-135 #65215 -> WS-8)
Hona added a commit that referenced this pull request Nov 20, 2026
…P-143 (#318)

- Fold confirmed merged PRs #307 (a1e7d0d, click-to-load reply videos),
  #306 (b5167f7, atomic agent_driven), #301 (6522f11, routed-session
  attach + recency closing #287 regression), #296 (95cb36a, legacy
  rune_mcp suppression + Half::is_builtin + check_cdp), #303 (6fb05ce,
  oc-preview:// app routing + raw file:// ban completing UP-095-PREVIEWS),
  and #316 (6e98fc2, Rune 7a707454 / #1307 strict local video opening)
- Add missing browser follow-up rows UP-095-3P-CONTRACT (#296 narrow
  third-party plugin browser contract gap) and UP-095-PROMPT-GATE
  (new-session-start-only prompt gate split from #302)
- Record #302 split (tunnel vs gate), #314 masking stream paused pending
  owner decision on agent-tab contexts, and updated browser Reviewed entries
- Audit upstream anomalyco/opencode 4122af0206..b9a60d9d07 (+11 commits:
  3 skipped, 8 added UP-136..UP-143)
Hona added a commit that referenced this pull request Nov 22, 2026
…tory change has landed (#706)

* fix(browser): back/forward never end their wait early, before the history change has landed

A back/forward wait ended at the load's end when a poll happened to see the page loading, which can be before the history change's DevTools events land; each bumps the tab's generation, so the agent's next command failed [browser.document_changed]. Measured on the published dev-469: 1 in 30. The wait now always runs to LOAD_SETTLE_GRACE (1.2 s) for back/forward, as 9 in 10 already did; next_wake wakes at the grace for them even after a load. Old since #287 (20 Nov). #696 is the real fix.

* fix(browser): a back/forward still loading past the grace waits for its load, not a 10 ms poll

READER-12b F1 on #706: with history set, next_wake stayed at the (past) grace, so a back/forward still loading after 1.2 s was polled every 10 ms until its load ended. Past the grace it now wakes at its deadline; the load's own messages wake the poll, as #696 does.
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