Skip to content

cua's own Chrome extension and native host: Chrome without a ChatGPT account (#10) - #80

Merged
SSFSKIM merged 45 commits into
mainfrom
feat/own-chrome-extension
Oct 8, 2026
Merged

SSFSKIM merged 45 commits into
mainfrom
feat/own-chrome-extension

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Closes #10

cua drives Chrome through its own extension ("cua", id jkejaaijdfpohkdhankllbekkhmnippb) and native host instead of OpenAI's ChatGPT extension, so the browser surface needs no ChatGPT or OpenAI account and no cua login. The agent-facing API is unchanged: the vendor's pinned browser-service.mjs still serves cua.getBrowser(...), createBrowserTab, tab.playwright; only the backend under it is cua's.

  • Host (src/chrome/host.mjs, protocol.mjs, extension.mjs): a Node program Chrome spawns per profile through a launcher; it serves the vendor backend protocol on $CUA_HOME/chrome/b/<12-hex>.sock with per-session, per-turn tab ownership (handoff/deliverable marks, late turnEnded, timeouts, user cancel, several cua serve clients). Its getInfo omits agentRequestHeaderEnabled, which is what removes the login (S0).
  • Extension (extension/): a thin MV3 relay of Chrome's tab, group and debugger primitives over native messaging, plus a minimal popup.
  • Registration and routes: cua chrome register now means the cua route; the ChatGPT route stays as cua chrome register --vendor until the Store listing. Discovery uses BROWSER_USE_BACKEND_PATHS; doctor, profiles and binding know both routes.
  • Linux: scripts/extension-pack.mjs (CRX3 + update.xml) and the relay's /ext/ route; the cloud VM template force-installs the self-hosted CRX (--extension hosted|store) with no sign-in step.
  • Packaging and docs: npm run extension:pack (Store zip without key); README, CLAUDE.md, the cua-remote skill and the cloud-VM docs updated; plugin 0.4.0.

Spec: docs/doperpowers/specs/2026-10-07-own-chrome-extension-design.md. Execution report: docs/doperpowers/specs/2026-10-07-own-chrome-extension-execution-report.md.

Do not merge yet. Acceptance 1 (after registration) and 3–6 still have to run live on the Mac. They need the owner to load extension/ unpacked in Chrome profile Default once, and later to quit and reopen Chrome. The commands are in the execution report under "Finishing H3b live".

Validation Evidence

Claim Command Result
Test suite passes (acceptance 10) npm test 945 tests: 944 pass, 0 fail, 1 skipped (baseline 785)
Vendor fixture contract unchanged node scripts/probe-chrome-contract.mjs --fixtures --report /tmp/cua-final-fx.json {"PASS":15,"FAIL":0,"BLOCKED":0}
No login needed (S0) node scripts/probe-chrome-contract.mjs --vendor --network default Session requests reached the backend in 3/3 runs. Control with the field present failed: Codex auth token is unavailable. Evidence: docs/evidence/2026-10-07-s0-no-header-spike.md
The real vendor service drives the real host node scripts/probe-chrome-contract.mjs --vendor --backend host 8/8 PASS, 4 runs (docs/evidence/2026-10-07-h1-host-probe.md)
Linux works unattended, no sign-in (acceptance 7) create-hetzner.sh --extension hosted --location fsn1; same on the Tart VM Doctor ok:true; chrome.hosts.live pass (1); verify.mjs problems: []; linux-chrome.mjs PASS. 3 m 45 s from nothing; server deleted (docs/evidence/2026-10-07-own-extension-linux.md)
Vendor manifests untouched (acceptance 2) register / unregister from a scratch home, sha256 before and after Byte-identical; io.github.ssfskim.cua.json absent again (docs/evidence/2026-10-07-own-extension-acceptance.md)
Store build (acceptance 8, zip/CRX half) npm run extension:pack, with and without CUA_EXTENSION_KEY Zip manifest has no key; CRX id, crx_id and update.xml appid all equal CUA_EXTENSION_ID; signature verifies
Whole-branch review opus, reviewer-high brief, ff25913..3eae3f9 "correct", no material findings
BLOCKED acceptance 1 (after registration), 3, 4, 5, 6 Waiting on the owner's unpacked load
BLOCKED acceptance 8, Store half Waiting on the listing (#78)

Unresolved Review Findings

Minor findings from the task reviews, each left on purpose. All are also in tech-debt-tracker.md under "cua's own Chrome extension and host":

  • src/chrome/host.mjs: attach and detach on the same tab are not serialized, as the vendor extension serializes them. A detach that races an attach leaves the debuggee held until the turn ends. Left because turn-end cleanup bounds it.
  • src/chrome/host.mjs and extension/background.js: a refused host keeps its chrome/logs/<pid>.log. The extension retries already_served and listen_failed every 5 s, because those refusals are transient. Left because it is bounded and the logs help diagnosis. A sweep would close it.
  • src/chrome/registration.mjs:
    • chooseVendorRoute can set the vendor record's mtime into the future under clock skew.
    • A re-register after a blocked unregister, or over a manifest that has vanished, orphans that browser's backup.
    • Left because the cases are unlikely and housekeeping-only.
  • src/runtime/doctor.mjs: the agent.* rows fail for a non-default home on a machine whose agent belongs to another home. Seen on the Tart VM's separate test home; not specific to this change.
  • Untested: an extension update through the CRX's update_url. No version bump was published.
  • Cosmetic:
    • A failed title on a new tab group is silent.
    • The stub's runtime.sendMessage also delivers to the sender.
    • test/extension-pack.test.mjs needs unzip.
    • A comment in the acceptance runner names the wrong worst-case path.

Owner actions

  1. For the live acceptance: load extension/ unpacked in Default. Later, quit and reopen Chrome when the restart runner asks.
  2. Chrome Web Store listing (Chrome Web Store listing for cua's extension (unlisted; owner action) #78): the exact steps are under "Owner: Chrome Web Store listing" in the execution report. They cover developer registration, the one-off first-upload zip with key.pem at its root (built outside the repo), Unlisted visibility, the drafted description and permission justifications, and what to send back (the Store URL). The extension's icons are placeholders, so real artwork is needed for the listing.

Residue

None beyond what is registered: #78 (Store listing, owner action) and #79 (removing the ChatGPT extension route, blocked by #78). The minors above are logged in tech-debt-tracker.md.

SSFSKIM added 30 commits October 7, 2026 03:54
…e, short socket paths, self-hosted CRX on Linux, Store key handling, one route per home, OOPIF/handoff/turn_id/timeout semantics, H3 split
…ntRequestHeaderEnabled, no login, network default vs off (--vendor --network); backend-path discovery live/dead; extension id jkejaaijdfpohkdhankllbekkhmnippb; evidence
… 5 s unanswered-getInfo cost, CUA_EXTENSION_ID)
…d protocol over the cua extension's primitives

Sessions bound to socket clients, per-session tab ownership ("tab owned by another session"), per-turn
cleanup (unmarked created tabs closed, deliverable and claimed released open, handoff kept detached and
resumed next turn; a late turnEnded leaves the next turn's tabs), executeCdp passthrough with the 10 s
timeout and detach, OOPIF targets, user-cancel never re-attached, getInfo from the host's own state with
no agentRequestHeaderEnabled. runHost: listens at $CUA_HOME/chrome/b/<sha256(instanceId)[:12]>.sock only
after hello, <name>.json status, <name>.log, home_missing / protocol_mismatch / already_served refusals,
1 MB host->extension cap, exit on port close. protocol.mjs promoted from the probe's frame.mjs with the
shared JSON-RPC peer; extension.mjs holds CUA_EXTENSION_ID and the host name. Tests against a fake cua
extension (test/helpers/fake-cua-extension.mjs).
…nst the real host with the fake extension on its stdio

launchVendor in vendor-layer.mjs is the one launch path for M7, S0 and H1 (spawn, stderr, handshake,
per-cell js + M7RESULT, turn_ended, stop). host-layer.mjs judges getInfo kept as chrome, createTab then
attach, a Runtime.evaluate answered by the fake reaching the agent's cell, turn-end closing the created
tab, no identity check, and the host's exit; evidence in docs/evidence/2026-10-07-h1-host-probe.md.
…st signature, socket-path bound 103 bytes / 37 chars) and the early H4 gate measurement
… or status; a late turnEnded resumes a handoff tab into the current turn; the log is renamed only after listening; notification handler errors are logged; Chrome-internal tabs are not claimed
cua chrome register (now the cua route; --vendor keeps the ChatGPT extension's) writes io.github.ssfskim.cua
manifests naming $CUA_HOME/chrome/host, a launcher that bakes CUA_HOME and execs this node on the checkout's
host.mjs with Node's own stderr appended to chrome/logs/launcher.log; refuses another home's manifest
(other_home; --replace backs it up and records its launcher, unregister restores it byte for byte) and a home
whose socket path would exceed 103 bytes. The route is whichever record was written last (src/chrome/route.mjs).
On the cua route cua serve and the listing launch set BROWSER_USE_BACKEND_PATHS to the cua-route bindings'
sockets plus those present (src/chrome/discovery.mjs); presence of cua's extension counts an unpacked load
(Local Extension Settings/<id>/); bindings record their route and the other route's are rebind_required;
doctor reports cua's extension, registration and launcher targets, and the sockets that accept a connection,
skips codex.login and omits chrome.host.config. The vendor acceptance runner passes --vendor.
…t are not registrations keep the route; route-aware missing-extension wording; checks header; second-register record assertion
…y gives CUA_EXTENSION_ID), proven against the real host under a chrome.* stub: hello and the kept instance id, per-session tab groups, debugger relay with child sessions and OOPIF targets, alreadyHeld, hostRefused in the popup, detach-all on port drop with the 5 s and alarm retries, message_too_large
…ebuggee (Chromium raises it only for this extension's own attachment), and the stub and H1's fake drop the fictional foreign refusal; Chromium-shaped getTargets (OOPIF type other, attached by any client); CDP errors as JSON strings and 'Detached while handling command.' in the stub; concurrent creates share one group; backoff after a lasting refusal kept in storage.session; the popup follows the worker's changes
…backoff clears it and tries once at once (re-renders never retry); the restart test models a dead worker (its port closes, Chrome keeps the attachments)
…eFacts, no login gate and the profile's own socket as the live host on the cua route), discovery, cross-site iframe and goto-latency cells, the user-tab claim (with its documented exception), turn-end marking, two-client refusal and Chrome-after-serve scenarios; serve-with-store checks the route's extension
…ifests byte-identical, cua manifests absent after unregister), the empty BROWSER_USE_BACKEND_PATHS hiding live vendor sockets; live items BLOCKED on the owner's unpacked load
…h the owner's key, id checked against the manifest key, update_url added) and update.xml; dist/ ignored
…erver); update.sh --ext publishes a packed dist (CRX before update.xml), installs the Caddyfile under the live site address after caddy validate, reloads Caddy, leaves the relay running
…te it checks the bound profile's own host (pre-listed socket, status naming the id, pid running host.mjs) and that it owns no tab after end_task, and needs no Codex login; the vendor route's runtimes check is unchanged
…the cua route: --extension hosted|store (hosted: the relay's update.xml) in the one managed force-list, the wait loop uses the presence rule and cua's host socket, both sign-in steps leave the checklist; --repo uploads a git bundle for an unpushed ref
…e relay's /ext/, force-installed over HTTPS on the Tart VM and a throwaway Hetzner VM; acceptance 7 PASS (Hetzner doctor ok:true, hosts.live 1, verify problems [], linux-chrome PASS, no sign-in); server deleted
…in parallel arrays (a path with a space no longer splits; test); READMEs: update.sh --ext replaces the live Caddyfile keeping only its site line, the CRX's update_url comes from the packer's --base-url, --repo takes a branch
SSFSKIM added 13 commits October 7, 2026 06:53
…im PASSes only with an accepted origin-access request for that origin during the claim and read; getInfo's missing header field checked on the host's raw answer; a home with auth.json is refused on the cua route; scenarios after a latched stop are BLOCKED; a restart with no starting pid fails; the open task's failure bounded at 15 s; goto latency per scenario for C2 too; the infobar is the owner's observation
…fest's key) always, the CRX and update.xml with CUA_EXTENSION_KEY (a refused key writes nothing); npm run extension:pack; package files gain extension/
…its popup, not the ChatGPT extension (H2's hand-off; codes and shapes unchanged); the Codex login is worded as the ChatGPT extension route's
…ua chrome register, profiles; the ChatGPT extension route, cua login and --vendor in their own subsection until removal; the Codex login optional), Linux and configuration rows, CLAUDE.md, cua-remote Part A, the new-Mac onboarding, cloud VM hosted or store (Chrome takes later updates from the installed CRX's update_url), npm run extension:pack in the relay docs
…, a disable/enable only for the ChatGPT extension
…e placed no live backend; no label on this route); README: the cua-route live acceptance needs a never-logged-in scratch home, the extension adds no page scripts (the agent acts through Chrome's debugger), the placed vendor host is used only after register --vendor; touched lines rewrapped to 120 columns
… input with transparent text (a password input, or one masked by -webkit-text-security, drew the owner's password manager's frame into the page and Chrome refused the debugger on the tab); browser-surface finds the getBrowser rule in profiles_list's description (moved there by #73); closeOwnTab polls the listing for 2 s (close returns before Chrome drops the tab)
…tch home (runner 40/40 twice, Chrome restart 11/11, vendor manifests byte-identical); evidence, spec Progress, Surprises and final Outcomes
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.

Browser strategy: ChatGPT extension, own extension + host, or the Playwright route

1 participant