Repository navigation
Browser first-use documentation fits inline in Claude Code (#494) - #508
Merged
Merged
Conversation
…owser, Tabs, Tab and a slim Playwright/locator reference; guidance by name (refs #494) Claude Code saves an MCP result of more than 50,000 characters to a file, and the first getBrowser() cell (core plus browser document) was 55.4K with the browser surface alone and 73.4K with a macOS computer surface. The first-use document keeps the selected browser, session naming and the requiredFor documents, the lookup catalogue and capabilities, and an API reference of Browser, Tabs and Tab whole with the common Playwright and locator members (SUMMARY, the manifest's own declarations). The safety, tab cleanup, interruption, API use and cua-browser-service guidance become lookups whose pointer states the rule; "api-reference" is the full reference, generated for the browser last documented. The browser document drops from 36.5K to 9.5K; first-use-inline.test.mjs holds the first cell at 47,500 or less on MAWS and a Chrome profile under every core, with the Tab interface in its first 7,000 characters. Own host 0.5.2. Sminos-Session: cursor235#b93055dd (cua on macbook)
…use split (refs #494) Sminos-Session: cursor235#b93055dd (cua on macbook)
…494) Sminos-Session: cursor235#b93055dd (cua on macbook)
…o its browser, and retries follow inspection (refs #494) Review of 435420c..2bed9d8. A lookup returns its text without showing it on the own host, so the catalogue's clause, the api-reference pointer, the capability lines, the manifest's documentation() comments and the required-documentation error all advertise nodeRepl.write(await ...); the parity oracle names the catalogue clause as cua's edit of the vendor's. A test runs each advertised example as written in a real kernel under cua's REPL host and checks the looked-up text in the visible tool response (and that the bare form shows nothing). The full reference is api-reference/<browser id>, one per documented browser, so after A, B, A each pointer reads its own backend's reference (covered with backends that differ on selectOption). The API use pointer says never blindly repeat, and to inspect and resolve before retrying, as its guide does. Sminos-Session: cursor235#b93055dd (cua on macbook)
…rence (refs #494) Sminos-Session: cursor235#b93055dd (cua on macbook)
Sminos-Session: cursor235#b93055dd (cua on macbook)
…494) Sminos-Session: cursor235#b93055dd (cua on macbook)
… one bound slot (refs #494) Since #494 the first-use document names its full reference as api-reference/<browser id> in the catalogue and the summary's pointer, and browser ids are numbered per service process, so the two hosts' documents differed in that name alone (hosted parity-browser, run 45158364542: 13 docs-profiles cells and api/cua/rewritedocumentation). normalizeSelectedBrowserDocument and applyBrowserIdentity now project exactly that name, delimited by its quote or backtick, with the header's ID; a pointer to another ID, a longer ID that starts with it, and the ID anywhere else still compare. Sminos-Session: cursor235#b93055dd (cua on macbook)
Sminos-Session: cursor235#b93055dd (cua on macbook)
SSFSKIM
marked this pull request as ready for review
November 23, 2026 13:00
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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 #494. Version 0.29.5 (main merged in at a08fa84). Design rulings 1107, 1133.
The gap
The first
getBrowser()result was about 55 KB in a MAWS session, so Claude Code saved it to a file instead of showing it. One agent had to grep that file to find the Tab interface. Another never read it and guessed browser ids.The measured limit
MAX_MCP_OUTPUT_TOKENSis a separate 25,000-token step and doesn't move this limit.claude -pruns (haiku, low effort, 12 tool calls in all) against a throwaway stdio MCP server, in a scratch HOME: 50,000 chars was inline and 50,001 was saved, the same split for two items, and the same with the token setting raised.The fix (cua's own host and the shared browser part; the vendor host's core document is untouched)
requiredFordocuments (unchanged), Browser, Tabs and Tab in full, and a slim PlaywrightAPI/Locator part drawn from the manifest's own declarations.browser-safety,tab-cleanup-chrome,browser-control-interruption,cua-browser-service,api-use-behavior). Each has a one-line pointer stating its rule and is read withnodeRepl.write(await agent.documentation.get(...)). A bareawaitreturns the text without showing it.api-reference/<browser id>, one per documented browser.Evidence
First cell, in characters (Chrome profile; MAWS differs by ~20):
interface Tab {now starts about 5,200 chars into the browser document (it was ~17,200).gotois at ~6,600.Tests:
test/cua-api/first-use-inline.test.mjschecks:It fails on main.
The focused set passes 165/165 (with
CUA_NODEon Node 26). browser-service, cua-api and repl-parity pass 1,254/0.Review (reviewer-medium): 2bed9d8 had 1 P1 (the lookup didn't print), 2 P2 and 1 P3, all fixed in d59091a except the one below. The re-review found nothing.
Limits
agent-cursor.md, which agent-cursor.md takes #494's treatment: rules inline, detail behind lookups, with its own first-cell budget (macOS computer+browser is 7% under the inline limit) #503 takes next (ruling 1133). The size test is the tripwire: a change that trips it does agent-cursor.md takes #494's treatment: rules inline, detail behind lookups, with its own first-cell budget (macOS computer+browser is 7% under the inline limit) #503's work, and the target is never raised.Parity
The full-reference pointer names its browser (
api-reference/<browser id>), and browser ids are numbered per service process, so they drift between the vendor and cua hosts. The parity oracle (scripts/repl-parity/docs-oracle.mjs,browser-identity.mjs) now normalises exactly that one slot, bound to the header's own id; a pointer to another id, or the id anywhere else, still differs (f052a51, with oracle tests). No declarations were added. Hosted parity-browser passes on 1670f7c (run 45173262693).Sminos-Session: cursor235#b93055dd (cua on macbook)