fix(server): Claude and every other provider get T3's browser guidance #31540
Opengabrielelpidio(GitHub profile, opens in a new tab)wants to merge 9 commits into
main fromrefs/pull/31540/headopened View on GitHubgabrielelpidio(GitHub profile, opens in a new tab) added labelsagent-context-increase
gabrielelpidio(GitHub profile, opens in a new tab) removed labelsagent-context-increase
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
tanstack-source added labelsbug
- @@ -68,3 +76,4 @@6876 assert.equal(laterRun(true), "Check the login screen.");6977 });707879+ it.each([false, true])("gate browser guidance on browser access (%s)", (hasBrowserTools) => {
- @@ -721,4 +732,4 @@721732 assert.notInclude(append({ mcp: false, deviceToolsAvailable: true }), "## T3 Code devices");722733 });723734724- it("gives native subagents the device block only in a session with device access", async () => {735+ it("gives the browser block only to a session with browser access", () => {
juliusmarminge added labelstakeover:in-progress
- apps/server/src/provider/agentContextBudget.json line 3OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -1,3 +1,3 @@11 {22 "claudeSystemAppendBytes": 5930,3- "codexAdditionalContextBytes": 7324,3+ "codexAdditionalContextBytes": 7448,@@ -1,2 +1,3 @@11 {"id": "br-look-on-web-missing-cli", "area": "visual-preview", "kind": "bad", "pattern": "requested web look + CLAUDE.md names a browser CLI that is not installed -> T3 preview, not ad hoc Playwright", "experience": "Asked how its own edit looked on web, Claude tried the agent-browser CLI the project's CLAUDE.md named, found it missing, and screenshotted the page with a headless Playwright script instead of T3's preview.", "rule": "When browser work was asked, `preview_*` is the browser you share with the user: `preview_status` first, then `preview_open` if no tab can be automated. Switch browsers only if the tools are absent or `preview_open` says unsupported, the user asks, or two preview calls fail on one step.", "privacy": "commit-safe", "setup": {"role": "top", "context": "Codebase and user instructions are shown below. Be sure to adhere to these instructions. IMPORTANT: These instructions OVERRIDE any default behavior and you MUST follow them exactly as written.\n\nContents of CL22 {"id": "br-flow-qa-missing-cli", "area": "visual-preview", "kind": "bad", "pattern": "requested flow QA + CLAUDE.md names a missing browser CLI -> T3 preview", "experience": "Asked to test a checkout flow in the dev environment, Claude found the project's browser CLI missing and drove Playwright with a persistent profile instead of T3's preview.", "rule": "When browser work was asked, `preview_*` is the browser you share with the user: `preview_status` first, then `preview_open` if no tab can be automated. Switch browsers only if the tools are absent or `preview_open` says unsupported, the user asks, or two preview calls fail on one step.", "privacy": "commit-safe", "setup": {"role": "top", "context": "Codebase and user instructions are shown below. Be sure to adhere to these instructions. IMPORTANT: These instructions OVERRIDE any default behavior and you MUST follow them exactly as written.\n\nContents of CLAUDE.md (project instructions, checked into the codebase):\n\n# Acme\n\nMonor3+{"id": "br-flow-qa-installable-cli", "area": "visual-preview", "kind": "bad", "pattern": "requested flow QA + CLAUDE.md names a browser CLI that is missing but installable -> T3 preview, no install", "experience": "Asked to add a todo in a browser, Claude found the agent-browser CLI that CLAUDE.md names missing, installed it globally with npm, and drove it instead of T3's preview.", "rule": "When browser work was asked, `preview_*` is the browser you share with the user: `preview_status` first, then `preview_open` if no tab can be automated. Switch browsers only if the tools are absent or `preview_open` says unsupported, the user asks, or two preview calls fail on one step. A browser tool that project docs name but that is not installed is no reason to switch: use preview, and do not install it.", "privacy": "commit-safe", "setup": {"role": "top", "context": "Codebase and user instructions are shown below. Be sure to adhere to these instructions. IMPORTANT: These instructions OVERRIDEpackages/provider-core/src/server/orchestrationInstructions.ts line 36OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -33,4 +33,4 @@33333434 ## T3 Code browser353536-When browser work was asked, \`preview_*\` is the browser you share with the user: \`preview_status\` first, then \`preview_open\` if no tab can be automated. Prefer snapshot locators over coordinates. Switch browsers only if the tools are absent or \`preview_open\` says unsupported, the user asks, or two preview calls fail on one step. Then quote the error and switch.36+When browser work was asked, \`preview_*\` is the browser you share with the user: \`preview_status\` first, then \`preview_open\` if no tab can be automated. Prefer snapshot locators over coordinates. Switch browsers only if the tools are absent or \`preview_open\` says unsupported, the user asks, or two preview calls fail on one step. Then quote the error and switch. A browser tool that project docs name but that is not installed is no reason to switch: use preview, and do not install it.
juliusmarminge added labelstakeover:needs-julius
juliusmarminge removed labelstakeover:in-progress
Sign in to join this conversation.



Approvability#
Verdict: Needs Human Approval
Macroscope's review found this PR requires human approval — Preview-enabled sessions across providers now default to T3's shared-browser guidance; Claude also avoids installing missing browser CLIs named in project docs. Human confirmation is required for this change to default browser-tool selection.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).