Skip to content

docs(skills): describe the browser run sandbox as QuickJS - #342

Merged
ankitranjan7 merged 4 commits into
mainfrom
docs/browser-run-sandbox
Aug 18, 2026
Merged

docs(skills): describe the browser run sandbox as QuickJS#342
ankitranjan7 merged 4 commits into
mainfrom
docs/browser-run-sandbox

Conversation

@ankitranjan7

@ankitranjan7 ankitranjan7 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Closes #337.

What

Rewrites skills/webcmd-browser/references/browser-run-playwright.md around what the browser run runtime actually is, and rewrites the pointer to it in SKILL.md.

Why

The old reference was 23 lines and described the environment as "normal Playwright globals." It never used the word QuickJS. That description is consistent with a Node-hosted Playwright script — which is what every public Playwright example looks like — so an agent reaching for Buffer to build a file payload, or document to read the DOM, is reasoning correctly from what we told it.

Observed in an internal agent-behaviour eval across seven browser tasks:

  • 5 of 7 agents never opened the reference. The pointer read "For sandbox boundaries, artifacts, errors, snapshots, and timings, read …" — a list of chapter headings, which is skippable.
  • The 2 who did open it failed on the sandbox anyway, because the answers were not in it.

Both mechanisms are addressed: the pointer now states the surprise (browser run executes in QuickJS, document is not in scope, Buffer does not exist), and the reference now answers the questions that were being asked.

Structure

  • What the runtime is, and the two consequences that cause most failures (DOM → page.evaluate, no Node globals)
  • What is available
  • What is blocked, each row naming the alternative
  • Files and binary data, including the in-memory payload path for setInputFiles
  • How to read QuickJS promise rejected: 'X' is not defined

The rewrite also fixes two claims the old doc got wrong, both re-verified against playwright-transport.ts rather than carried over: context.newPage() works (newPage routes to scope.createPage; it is closing the tab that fails), and page.$/page.$$ work (absent from DENIED_METHODS).

Cloud

Adds a hosted section rather than a separate document. Verified: webcmd-cloud imports runBrowserProgram from @agentrhq/webcmd/browser/run (src/browser/hosted-browser.ts:17), so hosted mode runs the same QuickJS sandbox against a Browser Use browser over CDP. The rules are identical in both modes and the doc now says so. No webcmd-cloud change.

Tests

Documentation only; no code paths touched.

🤖 Generated with Claude Code

The reference called `page`, `context`, `browser`, and `console` "normal
Playwright globals" and never used the word QuickJS. That reads as a
Node-hosted Playwright script, which is the belief that produces
`'Buffer' is not defined` and `'document' is not defined`.

Rewrites the reference around the actual model — your code runs in QuickJS,
not in the page and not in Node — and replaces "use the vendored Playwright
client as the API reference" with tables of what is available and what is
blocked, each naming the supported alternative.

Also corrects two stale claims, both verified against the transport:

- `context.newPage()` is supported; playwright-transport.ts routes `newPage`
  to `scope.createPage`. The doc said it was unavailable.
- `page.$`/`page.$$` are supported; DENIED_METHODS blocks only Browser.*,
  BrowserContext.close/newCDPSession, Page.close, and Playwright.newRequest.

The SKILL.md pointer now states the surprise instead of listing chapters,
because a table of contents is skippable and a warning is not.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

🟢 No documentation gap found — medium confidence

The automated review found no documentation gap in the supplied changes.

This review is advisory and does not block merging.

ankitranjan7 and others added 3 commits August 18, 2026 23:12
The skills content guard pinned the old "Sandbox boundaries" and "Artifact
paths" headings, which this branch renamed. Assert the concepts the doc now
teaches instead — the QuickJS runtime, the page.evaluate boundary, and
artifacts — which is a stronger check than the old heading match.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
#347 moved published skills to skill-src/*.src.md sources built by litprompt.
The rewrite and SKILL.md pointer must live in the sources so 'make verify'
passes; the published .md files are regenerated from them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ankitranjan7
ankitranjan7 merged commit 0c3d726 into main Aug 18, 2026
37 checks passed
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.

docs: browser-run-playwright.md describes the QuickJS sandbox as "normal Playwright globals"

1 participant