Repository navigation
Conversation
…into security/browser-stream-capability
…into security/browser-stream-capability # Conflicts: # src-tauri/src/agent_browser.rs
…into security/browser-stream-capability # Conflicts: # src-tauri/src/agent_browser.rs
…/browser-stream-capability # Conflicts: # src-tauri/src/agent_browser.rs
…/browser-stream-capability
…/browser-stream-capability # Conflicts: # src-tauri/src/agent_browser.rs
…into security/browser-stream-capability # Conflicts: # src-tauri/src/agent_browser.rs
…into security/browser-stream-capability # Conflicts: # src-tauri/src/agent_browser.rs
…into security/browser-stream-capability # Conflicts: # src-tauri/src/agent_browser.rs
# Conflicts: # src-tauri/src/agent_browser.rs
# Conflicts: # src-tauri/src/agent_browser.rs
|
@mario-reviewer review |
mario-reviewer
left a comment
There was a problem hiding this comment.
Static review of 7ec7df45febbd750a25ce70ef5bda2825ac3873f. No prior reviews were present.
src-tauri/src/agent_browser.rs:2804— Warning (blocking): macOS cannot retire a verified pre-upgrade daemon.browser_listener_token_for_close(record, session)returns no token for a surviving daemon from the unpatched build, so macOS never reaches its only shutdown path andstop_previous_browser_daemon_before_streamrefuses to reopen that session while the old daemon lives. Fix: Add a migration-only close for positively identified legacy daemons, retaining the private-record, process-start, and connected-peer PID checks; keep token-based close mandatory for patched daemons. Add a regression test for upgrade from a verified legacy daemon without a secret.src-tauri/src/control_identity.rs:371— Warning (blocking): the new read-only viewport action changes app state. Classifying"viewport_status"asAccess::Readroutes a read-only caller through session allocation and pane creation or live-state updates beforecontrol.rs:1867checks whether there is a stream. Fix: Resolve only an existing session and return its verified viewport before the shared mutation path; test that an empty workspace stays unchanged when queried by a read-only caller.scripts/patches/agent-browser-v0.44-codemux.patch:229— Warning (blocking): confirmation IDs are not unique per prompt.confirmation_id: id.clone()uses the command's correlation ID, which the upstream confirmation replay preserves, so a follow-up prompt can accept a stale decision for the preceding prompt. Fix: Generate a fresh daemon-owned ID every time a command is parked, publish it separately from the response correlation ID, and test that the previous ID cannot confirm or deny a follow-up.scripts/test-agent-browser-listeners.mjs:127— Suggestion: verify the HTTP relay response body.assert.match(await command(a.token), /^HTTP\/1\.1 200 /)passes even if the daemon rejects the relayed command, because the HTTP handler wraps a daemon JSON error in a 200 response. Fix: Read the full response and assert that the JSON body reportssuccess: true.
CI: The exact-head GitHub Actions run passed all eight checks, including ci-gate and browser-sidecar-macos. No repository code was built or run during this review.
Verdict: REQUEST_CHANGES
🤖 Automated review by Mario (AI). Findings may be wrong; a human makes the final call.
Bring in #784's commits 8897feb and c2f9249 (daemon-owned confirmation IDs, legacy daemon close, read-only viewport) and every #758 follow-up the pipe branch lacked. The CDP pipe patch is regenerated over the new auth patch, and its approved-navigation test now sends the parked confirmation ID that the auth patch requires. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#784's test for retiring a verified pre-upgrade daemon without a secret is macOS-only and no CI job ran it. The macOS sidecar job already builds the benchmark crate, which includes agent_browser.rs, so run it there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mario-reviewer
left a comment
There was a problem hiding this comment.
Re-reviewed c2f92494194599dff2f191de75e2eb42ce1a2295. No blocking findings remain. The macOS migration close verifies the old daemon and connected peer; viewport status no longer creates a browser session or pane; replayed commands receive fresh prompt IDs. The HTTP relay test now checks the JSON result.
- Suggestion —
.github/workflows/ci.yml:621–623. The macOS job filters its Rust test invocations tofailed_mac_open_closes_its_late_published_daemonandreal_sidecar_prior_launch_token_recovery_and_close, so it compiles but does not runmacos_reclaims_verified_legacy_daemon_without_a_secret. Fix: Add the legacy-reclaim regression to this job so CI exercises the migration path.
CI (exact head): All eight checks passed, including ci-gate and browser-sidecar-macos. Static review only; no repository code was built, installed, or run during this review.
Verdict: APPROVE
🤖 Automated review by Mario (AI). Findings may be wrong; a human makes the final call.
Problem
The bundled browser sidecar accepted unauthenticated local requests on its stream WebSocket, stream HTTP API, and daemon command channel. Direct connections bypassed Codemux's desktop bridge and paired remote proxy. The flaw was confirmed in pinned v0.24.0 source and remained in the v0.44.0 source used by #758, which this PR stacks on.
Change
Build a Codemux-owned sidecar from pinned v0.44.0 source with an in-repo authentication patch. Codemux keeps a random per-launch secret in memory, derives a separate token for each browser session, and supplies it through managed CLI launches, the desktop bridge, and the authenticated remote proxy. The sidecar requires that token for WebSocket handshakes, every stream
/api/*request, and Unix socket or Windows loopback daemon commands. Persistent session URLs contain no token; Unix control sockets live in owner-only directories. Previous daemons are used only after process and session identity verification.The patched sidecar also requires a fresh daemon-owned
confirmationIdfor each parked prompt before consuming a pending confirm or deny request, including prompts produced by replay. Managed browser operations require the patched binary version, have no PATH or package-runner fallback, and fail packaging when the patched binary is absent.The macOS sidecar benchmark includes the production OS input module, and verified close cleanup retains its session value for the subsequent recovery check. A verified daemon from the previous unauthenticated build can be closed without a listener token only after private-record, process-start, prior-owner, environment, and connected-peer checks. Read-only viewport queries use an existing session and cannot create a pane.
Verification and base
90287500c825fd3e06a8f312d3eff246fcf7dbf9. Its exact-head CI run passed changes, Iroh/WASM, Ubuntu and Windows web and Rust, and ci-gate without a rerun. This PR is pushed atc2f92494194599dff2f191de75e2eb42ce1a2295.f45eb07147f70cc4b26eed193e2aa11dfa4ce1be, localcargo check -j 2, close replay 7/7, confirmation 36/36, agent close 8/8, pane close 11/11, screenshot 17/17, authenticated Unix confirm/deny, stream token, and current/prior close token regressions passed. The real sidecar recovery/close and live listener smoke covered missing, wrong, cross-session, and correct tokens plus wrong confirmation IDs preserving the pending command.git diff --checkpassed.7ec7df45febbd750a25ce70ef5bda2825ac3873ffixed the macOS compile errors. Local Linux app and benchmark checks, real patched-sidecar prior-launch token recovery/close, live listener smoke, and diff checks passed. Full exact-head CI run 45942173426 finished SUCCESS on attempt 2: macOS sidecar, Windows native/Cargo/installer, both web jobs, Iroh/WASM, changes, Ubuntu Rust, and ci-gate passed. Ubuntu Cargo passed on attempt 1; an unchanged native provider smoke timed out under runner scheduler load and passed on one failed-job rerun.c2f92494194599dff2f191de75e2eb42ce1a2295fixes them. Localcargo check -j 2, the read-only viewport and listener identity Rust regressions, focused optimized sidecar confirmation tests, the rebuilt pinned sidecar, live WS/HTTP/daemon listener smoke, Node syntax, and diff checks passed. The macOS legacy migration fixture awaits full exact-head CI run 45989074051, which is in progress. This PR remains draft pending that run and latest-head review.Remaining boundary
This is a partial listener fix. Chromium still starts with
--remote-debugging-port=0; a local probe reached its unauthenticated/json/versionendpoint. On a host where users share a network namespace, another local OS user can reach that CDP port, so this PR does not establish local-user browser isolation. Same-user code may also read the sidecar token from child process environments. The standalone upstream dashboard is outside Codemux's managed browser path and is not wired to the new token.Implemented by GPT-6 via T3 Code's Codex harness.