Repository navigation
Own browser service M1a: service skeleton, CDP controller, the switch and trust root (#113) - #122
Merged
Merged
Conversation
… vendor's sentences, the lifted clamp, Deadline)
…nativePipe, the session API, the turn-ended tracker, discovery)
…retry reattach, frame routing, events and the raw queue, dialog tracking and blocking)
…dline through the tab's attachment and document reads, and rechecks an open dialog just before dispatch
… timed out a setup command its starter's deadline bounded
…red-attachment rules
…cuteWithRecovery over COMMAND_HANDLERS; manifest, documentation, browser selection, tabs, navigation, the per-backend session)
…root for src/browser-service, the two-pin version guard and the service's rejection classification
…EPL client through the wrapper and node_repl's RPC boundary: dialog_open, unsupported_command, tab_not_found, and the locator timeout and strict-mode sentences' path)
… a milestone's subset; the first expected difference (dialog_open)
…owserTab's snapshot read is served only from M1b; reads/snapshot covers it)
…a against vendor-1: 0 unexpected differences; the vendor control run for the new case setup)
…names, comment and import order)
…ask 2's decisions
…nce (a service error's code never reaches the kernel); README says so
…ported_command before the required-documentation check
…il its deadline (or its timeoutMs and a grace); an abandoned request is dropped, never re-sent
This was referenced Oct 13, 2026
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.
M1a of the own browser service (#113, child 1 of #114): the service skeleton behind the switch. Spec:
docs/doperpowers/specs/2026-10-13-own-browser-service-design.md(Plan of Work M1a; execution rulings in its Decision Log and Surprises dated 2026-10-13). The default staysvendor; nothing changes for users who do not setCUA_BROWSER_SERVICE=cua.What changed
src/browser-service/(ported from the readable vendor tree, provenance headers on every ported file):errors.mjs(BrowserServiceError, KEPT_REASONS, the vendor's sentences),budgets.mjs(clamp to 120 s, Deadline),backend.mjs(framed JSON-RPC over nativePipe, the session API, turn-ended tracker, discovery; refuses a backend announcingagentRequestHeaderEnabled),cdp.mjs(port of the vendor's CDP controller: attach, one-retry reattach, OOPIF routing, event queue, dialog tracking and blocking; the command's deadline enforced on every dispatch and after it),index.mjs(handleRpcwith setup/execute/executeWithRecovery per the spec's REPL contract,COMMAND_HANDLERS), manifest, tabs, browsers, session, navigation, documentation with thecua browser service 0.1.0marker,VERSION.CUA_BROWSER_SERVICE=cua|vendor(default vendor; invalid values failinvalid_browser_service);src/runtime/launch.mjsadds exactly the real path ofsrc/browser-serviceto the trusted code paths whencuais selected;src/services/browser.mjsloads the selected module, pins both versions (vendor 0.1.1, cua 0.1.0) and fails closed before any secret is read;rejectionKindclassifiesBrowserServiceErrorby kept code.diff --scenarios;expected-differences.jsonwith its first entry (dialog_open); the corpus's cua-side oracles assert the plainErrorand the sentence, because onlyerror.messagecrosses node_repl's RPC boundary; parity cases open tabs withtabs.new+gotountil M1b servescreateBrowserTab's snapshot.CUA_BROWSER_SERVICEconfiguration row.Validation Evidence
HOME=/tmp/cua-scratch-home npm testat aad5235:# pass 1303,# fail 0,# skipped 37(one of three runs; see Unresolved Review Findings for the two pre-existing flakes in the other two).npm run test:mods→32 pass,0 fail;claude plugin validate .→✔ Validation passed with warnings(the known CLAUDE.md warning).test/browser-service/real-client.test.mjs, the installed bundled client through the wrapper and node_repl's RPC boundary: dialog_open, unsupported_command, tab_not_found, the locator timeout and strict-mode sentence paths): 4/4, three runs in a row (skips visibly under a scratch HOME without the installed runtime).ssfs, parity clone):node scripts/browser-parity.mjs diff docs/evidence/2026-10-13-own-browser-service-parity/vendor-1 <cua run> --scenarios <M1a>→ 0 unexpected differences (6 cases, 30 cells); a vendor control run diffs to 0 for the tab-setup change. Evidencedocs/evidence/2026-10-13-own-browser-service-parity/m1a-diff.txt. The live run was taken at 4b88013; the later commits change only non-M1a oracles (679a251), the documentation-gate order (3f93fbd) and the post-dispatch deadline (aad5235, timeout paths only), so it was not re-run.doperpowers:reviewer-high: one P2 (the deadline was not enforced after dispatch because the host awaitsdebugger.detach), fixed in aad5235; re-review "correct", no material findings.Unresolved Review Findings
test/extension-host.test.mjs"commands in flight when the user cancels debugging or closes the tab fail with Chrome's 'Detached while handling command.'" failed once (ECONNREFUSED on the fake socket) andtest/mcp-upstream.test.mjs"owned descendants left in the process group after the runtime exits are reaped" failed once; both files pass 5/5 in isolation. Left because they predate this branch and look load-timing related; listed under Residue.Residue
test/extension-host.test.mjs"commands in flight when the user cancels debugging…",test/mcp-upstream.test.mjs"owned descendants … are reaped") each failed once in three full runs and pass in isolation; worth a ticket to harden their timing so every milestone's gate is deterministic.