Repository navigation
MAWS in-app browser driven by cua_repl: client-mode host, MAWS backend discovery, maws profile (#13) - #91
Merged
Conversation
…exclusive automation ownership, tabs.adopted, takeover classes, closeTarget, A-42, vendor API names)
…wo-session proof)
…sonHolds gate, closeTarget acting, chooser reset)
…ENDS, its discovery and default selection, and the maws entry in profiles_list cua serve and cua profiles list connect to each configured MAWS socket and run the host over it in-process, listening at chrome/m/<name>-<pid>.sock while connected and retrying every 5 s. The launch lists those hosts first and prefers the first backend's instance; the trusted browser wrapper rewrites an unqualified selection to it, so cua.getBrowser() is the in-app browser or the vendor's unavailable error, never a Chrome profile. The host turns moveMouse into cursor.move for a peer whose hello names its profile, forwards timeoutMs on debugger.sendCommand and owns tabs.adopted popups. profiles_list lists maws first (ready or maws_unreachable) with the MAWS rule in its description; maws keys are reserved; bind and readiness ignore maws: instances; doctor reports maws.hosts.
…e, features page additions, README For MAWS, plugin 0.5.0 scripts/accept/maws-features.mjs drives a configured backend as an agent inside MAWS would (profiles, createTab, locator, viewport, popup, cleanup, isolation with --other; download, alert, confirm and chooser are M3's slots). scripts/accept/maws-selection.mjs proves the default selection against a fake MAWS peer and a Chrome-shaped one with the real vendor runtime. The features page gains #name, #submit, #popup and /popup.
…eviewer rung note
CUA_BROWSER_DEFAULT_INSTANCE carries the first backend's instance id, or the bare marker maws: when no hello arrived before launch. The trusted wrapper resolves an unqualified selection when it is made: the listed browser with that instance id, else the first listed maws: browser, else the vendor's own unavailable error; never a Chrome profile. A cua serve started while MAWS was down now selects MAWS once it returns, without a restart (maws-selection.mjs late-start steps, live against the real runtime).
… JPEG (the vendor's tab.screenshot answers JPEG; found by M2's first run against real MAWS)
…ce 3 reads an image
…eld callback (S1)
…rome route's feature cells on the created tab; the served page's own file transfers accepted; the downloaded file removed once proven the run's)
… the app's life (M3 fix wave decision)
…refused, downloads follow personHolds)
…vidence per item (1-15), the probes and their outputs, the inside-MAWS sitting for the blocked items; README For MAWS: a held tab as the agent sees it and a session-scoped plugin; tech-debt row
…ed as measured or read
… acting event restored)
…ots rowed and cursor-free, keyboard typing rowed, takeover as revised, a screenshot during a hold, the cookie jar refused, the panel-opens e2e; findings A-C updated, E added; the cookie-jar probe
…ld select the owner's Chrome; whole-branch review)
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.
Closes #13
Summary
This PR is the cua half of the MAWS in-app browser change. A Claude Code session running inside MAWS now drives MAWS's own browser tabs through
cua_repl, using the same vendor browser API it uses for Chrome. The design and its living record are in the specdocs/doperpowers/specs/2026-10-08-maws-in-app-browser-design.md; its Decision Log lists every decision taken during execution.The MAWS half is SSFSKIM/MAWS#1.
cua serveandcua profiles listreadCUA_BROWSER_BACKENDS, a list of MAWS session sockets. For each socket they run the host in client mode: connect, wait up to 5 s forhello, then retry every 5 s. Each process listens on its own socket underchrome/m/, and nothing scans that directory, so no process can list another process's MAWS backend.BROWSER_USE_BACKEND_PATHSbefore the hello arrives. On the vendor route the/tmp/codex-browser-usesockets are added as well.maws:instance, otherwise the vendor's own "unavailable" error. It never selects Chrome. When the user names a Chrome profile, that selection passes through unchanged.profiles_list: gainsmawsentries, either ready ormaws_unreachable. Themawsandmaws-<n>keys are reserved. The tool description gets a MAWS line and stays at 1,194 characters, under the 2,048 cap.moveMouseascursor.move. It handlestabs.adopted, which the host owns and which creates no duplicate tab. It passestimeoutMsondebugger.sendCommandand putsprofileNameingetInfo. The Chrome route behaves identically: a hello withoutprofileNamechanges nothing, and the extension ignorestimeoutMs.scripts/accept/maws-features.mjscovers profiles, createTab, locator, viewport, popup, download, alert, confirm, chooser and cleanup, plus isolation via--other.scripts/accept/maws-selection.mjscovers the default-selection pins, including a MAWS that starts late.test/helpers/fake-maws-peer.mjsprovides a fake MAWS peer.docs/evidence/2026-10-08-maws-in-app-browser.md.Validation Evidence
Unit and integration suite.
npm testat fabc6b3:# tests 1034,# pass 1033,# fail 0,# skipped 1(the skip was already there). I ran it 5 times at this head. One of the five runs had a single failure that did not recur in the other four, and I did not identify which test it was.Selection probe.
CUA_HOME=/tmp/cua-h13 node scripts/accept/maws-selection.mjspassed 11/11 against the real vendor runtime 26.928.40906, with a fake MAWS peer and a Chrome-shaped fake peer. It covers: the default is maws; MAWS down reads asmaws_unreachable; the default fails closed; an explicit Chrome selection still works; reconnect is ready within 10 s; the default is restored in the same REPL heap; and acua servestarted while MAWS is down picks MAWS up once it returns.Live harness.
CUA_HOME=/tmp/cua-h13 CUA_BROWSER_BACKENDS=<dev MAWS session socket> node scripts/accept/maws-features.mjs --report … --other <second session socket>ran against a MAWS built from the MAWS branch at a47603a4 and the real vendor runtime. It returned{"profiles":"PASS","createTab":"PASS","locator":"PASS","viewport":"PASS","popup":"PASS","download":"PASS","alert":"PASS","confirm":"PASS","chooser":"PASS","cleanup":"PASS","isolation":"PASS"}. The download's sha256 matches the fixture, no save dialog appeared, and the file was removed afterwards.Per-item results. All acceptance items that need no app session passed. The evidence file has a section for each of items 1-15, with commands, outputs, the probes under
docs/evidence/2026-10-08-maws-in-app-browser/probes/and their JSON outputs.BLOCKED, waiting on the owner's sitting. These need a MAWS session whose engine loads the 0.5.0 plugin:
The sitting's steps (S1-S7) are in the evidence file. They load the plugin with the engine's
--plugin-dir, which leaves the installed plugin and its cache untouched.Unresolved Review Findings
profiles.json(M1, logged intech-debt-tracker.md). Aprofiles.jsonthat does not parse hides themawsentry. Left because a broken registry is already reported by doctor.tech-debt-tracker.md). Each client-mode host process writes its own log file, and nothing prunes them. Left because the files are small and doctor already sweeps stale status records.tech-debt-tracker.md; the fix would be in MAWS). A screenshot taken while the person holds the tab takes about 1.6 s. The vendor'sdevicePixelRatioread is classed as acting, so MAWS holds it and then refuses it. Left because the person stays protected and the agent still gets its screenshot. Making it immediate needs an exact-expression exception pinned to the 0.1.1 vendor.Residue