Give Braid's test subagent a browser it can drive (Playwright MCP) #17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Braid's agents can run Playwright test files (
npx playwright testthrough bash), but they cannot drive a browser: open a page, click through it, read the console and look at a screenshot of what is actually on screen. That is what verifying a UI change needs, and what the operator's own opencodetestsubagent does.Why
What exists
src/osf/engine/shape.pycan already attach@playwright/mcpto a node (--headless --output-dir <screenshots>), andplaywrightis inKNOWN_MCP_SERVERS. No node uses it, the package is unpinned (@latest), and there is no tool allowlist because its cost was never measured.testsubagent (~/.config/opencode/opencode.jsonc) getsplaywright*withbrowser_snapshot(the whole-page accessibility tree, ~20k tokens a call),run_code_unsafe,file_upload,dropandtabsdisabled, and works fromfind+ screenshots it reads itself.Proposal
Once the
apply-delegates-to-subagentschange lands (atestsubagent with no editing, background runs, image input declared on the model):testsubagent only, pinned to a version, with a measured allowlist (nobrowser_snapshot), screenshots written under the worktree's gitignoredui/test-results/.PREVIEW_PORT;testgets the URL, a scripted scenario and pass criteria, and returns PASS / FAIL / UNCLEAR with screenshot paths and quoted console errors.testtook under its delegation header.Open questions
npxfetching the MCP package at run time acceptable, or should it be pre-installed on the host?MCP_ALLOWLISTmeasured forgejo's.HOME.Shipped in #91 (OpenSpec change
2026-09-27-browser-subagent, archived on the branch); this issue closes when it merges.How it differs from the proposal here:
browsersubagent, nottest.testruns suites often, and the browser tools would be re-sent on every one of its turns; a narrow prompt also suits a 27B better.browserhas no shell and no edits.browser_snapshot;findreturns the refsclicktakes. Also out:run_code_unsafe, file upload, drag/drop, tabs, network.taskchild inherits its parent prompt's tool map, so a prompt-levelplaywright*: falsetook the browser off the subagent too. Playwright is now switched off per agent in the run config.@playwright/mcp@0.0.80, same Chromium 1243 as the image) and pre-installed in the image, not fetched by npx. Headless Chromium runs fine under the run's isolated HOME. Screenshots go to<run>/screenshots, outside the worktree, notui/test-results/(a relative filename wrote into the worktree, so the run plugin drops it).browsertask while one is busy.PREVIEW_PORTand handsbrowserthe URL, steps and pass criteria.browser · screenshotcall in the subagents panel.agent.test.browser, in default, git-flow, minimalist, git-flow-hotfix and quick-fix. It runs when UI files changed, the app can be served and the run hasbrowser, and a report still saying fail fails the step.Not yet verified: qwen3.8-27b actually driving the browser (every test used a scripted fake model), and the image build with the new install.