[Bug]: With agent browser/device access off, the agent still sees every preview_* and device_* tool #17202
Note
Written by Claude (Claude Code, Opus 5.5) at my request, and reviewed by me before posting.
Before submitting#
- My Claude searched existing issues and did not find a duplicate.
- Claude included enough detail to reproduce or investigate the problem, and I checked it.
Area#
apps/server
Steps to reproduce#
- In Settings, turn off "Agent browser access". Leave "Agent device access" off (the default).
- Start a new Claude Code thread.
- Ask the agent to list its
mcp__t3-code__*tools, then to callpreview_statusanddevice_list.
Expected behavior#
The agent does not see the preview_* and device_* tools. That is what the setting's doc comment says (settings.ts):
Turning this off withholds the MCP credential, so the
t3-codeserver (and with it everypreview_*tool) is never attached to a provider session, and the prompt text describing those tools is dropped along with them.
enableAgentDeviceAccess is documented to gate the device_* tools "the same way" (settings.ts).
Actual behavior#
The agent sees all 14 preview_* tools and all 4 device_* tools. Calling them fails.
preview_status:
MCP credential does not grant the preview capability: browser preview tools are off for this thread. Do not retry them. To check a page, use a headless browser from the shell, such as Playwright, or curl. The user can turn on "Agent browser access" in Settings; it applies when the agent session next starts.
device_list:
Agent device access is turned off for this environment.
So the setting blocks the calls, but the tools are still offered to the agent.
Impact#
Minor bug or occasional failure
Version or commit#
0.0.45 (desktop)
Environment#
macOS 14 (Darwin 23.6.0), Claude Code 2.1.294
juliusmarminge added labelsbug
juliusmarminge added labelsvia-triage
Thanks for tracing this. I reproduced the catalog mismatch with Codex 0.161.0 through both the authenticated HTTP endpoint and the native Codex API.
Your first proposed fix is supported by Effect's existing
McpSchema.EnabledWhenannotation. I have a local implementation that reads the authenticated invocation scope when tools are discovered and called. It filters the shared catalog without dependency changes or per-provider tool filters. Browser and device groups remain independent, other tools remain available, and the existing handler permission checks stay in place. Calls to hidden tools are refused before reaching their handlers.On unchanged main at
12069eefd, both access settings off still produced all 80 tools, including 21 browser tools and four device tools. On local commitf6b2b7fc, based on that revision, HTTP discovery and fresh native Codex conversations agreed:- Neither capability: 55 tools.
- Browser only: 76 tools.
- Device only: 59 tools.
- Both: 80 tools.
The real T3 manager, credential registry, HTTP registration, adapter and native process ran against isolated state. Unrelated domain services were stubbed, and only Codex was tested live. All 32 focused MCP tests passed, along with server typecheck, targeted lint/format and the server bundle build. The test command, from
apps/server, was:../../node_modules/.bin/vp test run src/mcp/McpHttpServer.test.ts src/mcp/McpDeviceToolkit.test.ts src/mcp/toolkits/worktree/registration.test.ts src/mcp/McpInvocationContext.test.tsI also checked access changes in both directions while attached: the credential and catalog stayed unchanged until idle detach/reopen, which refreshed both while preserving the native conversation and process. This implementation follows the credential's capabilities and preserves that lifecycle behavior. Model-payload token savings remain to be measured.
I'd like to contribute this fix. Would you accept a PR limited to authenticated catalog filtering, its tests, and corrections to the outdated settings comments? I'll rebase onto current main and repeat the focused checks before opening it. I'll propose broader orchestration-context improvements separately in Ideas.
Note
Written with GPT-6.1 Sol (Codex) at my request, and reviewed, edited, and approved by me.
Attempted on current main a50cd989ae using the Linux web dev server and Claude Code 2.1.303. Turned Agent browser access off in Settings → Integrations and confirmed Agent device access was off. Started a new-thread draft; Claude reported authenticated in Providers but was absent from the model picker. The environment then disconnected; reloading still showed “T3 Code on fs-30 did not answer.”
The VM reached load 40 on 4 cores, with provider-probe timeouts and event-loop stalls. The tool-listing step could not be reached, so this attempt neither confirms nor disproves the report. Verification needs a responsive host with a selectable Claude session. Leaving the issue open.
Runtime attempt and selected logs


juliusmarminge added labelsneeds more info
juliusmarminge removed labelsneeds more info
Reproduced on current main 3b95e7831b, Linux web dev server with Claude Code 2.1.303 / Opus 5.5. In Settings → Integrations, both Agent browser access and Agent device access were off. A fresh Claude thread was offered 19 preview tools and four device tools; preview_status and device_list each returned the reported capability denial. Removed needs more info. Runtime transcript.
I reproduced the browser side of this on macOS with a Codex thread in Nightly 0.1.12-nightly.20261123.5138. With Agent browser access off, the thread still saw
preview_*, and its shared instructions still said “preview tools only.” Callingpreview_statusreturned the capability denial. The agent stopped there even though Ego Browser could open and read a test page from the same session.I tested a local patch on
cd128e77that uses the preview capability for both the MCP catalog and browser guidance. The HTTP tests confirm thattools/listandtool_searchhidepreview_*andt3_preview_*with access off, and expose them with access on. The Codex context test also checks every injected entry for leftover browser instructions. HTML rendering and the other T3 tools are still available with browser access off.The existing catalog fix is a good place to cover this. Could it also move the browser-specific line out of the shared orchestration instructions and gate it with the browser capability?
Reproduced and tested with Codex in T3 Code.
Reproduced on macOS with Antigravity (ACP) and Pi in T3 Code Desktop
0.1.13-nightly.20261125.5245(1c3f0ee88f), with"enableAgentBrowserAccess": falseglobally and no per-project overrides. Verified the same code is still present onmain(as ofv0.1.14-nightly.20261128.5385).In addition to
McpHttpServerstill advertisingpreview_*/t3_preview_*intools/listand the sharedT3_CODE_ORCHESTRATION_INSTRUCTIONSstill containing the"preview tools only, no web fetch"bullet (which also caused a Pi session in the same thread to refuse using an external browser CLI even when asked), there is an ACP-specific instruction gating gap:- In
packages/provider-core/src/server/orchestrationInstructions.ts,T3AcpInstructionStateandt3AcpPromptWithInstructionsgateT3_CODE_DEVICE_TOOL_INSTRUCTIONSonhasDeviceTools, but unconditionally injectT3_CODE_BROWSER_TOOL_INSTRUCTIONS(## T3 Code browser, telling the agentpreview_*is the default browser) wheneverhasT3Mcpistrue—there is nohasBrowserToolsflag passed frompackages/provider-acp/src/server/adapter.ts(unlikeapps/server/src/provider/CodexDeveloperInstructions.ts, which checkstools.browser).
Environment: macOS (
darwin arm64), Nodev24.22.1, T3 Code Desktop & Server0.1.13-nightly.20261125.5245, Antigravity (ACP) & Pi.Drafted by Gemini 4 Neon (Antigravity) via T3 Code triage.
- In
Sign in to join this conversation.
Note
Grok responding on behalf of Julius.
Thanks for the clear report. I traced this through the code on
main(a4c9494b). I didn't reproduce it at runtime, but the code matches what you saw: the settings only control which tool calls are allowed. They don't change which tools the agent is offered. The doc comment insettings.tslooks out of date.What happens#
ProviderSessionManager.prepareMcpSessiongives every thread a credential withorchestration,worktreeandpull-requests. It addspreviewordeviceonly when the matching setting is on (apps/server/src/orchestration-v2/ProviderSessionManager.ts:485-491, issued at:523-528). So thet3-codeserver is attached whatever "Agent browser access" is set to./mcpis a singleMcpServerwith every toolkit registered at startup, includinglayerPreviewToolkitandlayerDeviceToolkit(apps/server/src/mcp/McpHttpServer.ts:850-861). The auth middleware resolves the credential and passes it to the request (McpHttpServer.ts:147-180). I couldn't find anything that filterstools/listby it, so every credential appears to get the full list.requireThreadMcpCapability("preview")(apps/server/src/mcp/toolkits/preview/handlers.ts:65,:252). That produces thePreviewAutomationUnavailableErrortext you quoted (packages/contracts/src/previewAutomation.ts:830). The device tools userequireThreadMcpCapability("device"), which maps to "Agent device access is turned off for this environment." (apps/server/src/mcp/toolkits/device/handlers.ts:70-77). This is a server-wide setting (one per environment), and the capability is fixed when the credential is issued, so the device tools are gated the same way.t3-codewhenever a session credential exists and pre-approvesmcp__t3-code__*(apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts:960-988). Codex adds it tomcp_serverswithout a tool filter (CodexAdapterV2.ts:1336-1347). Pi registers every tool it gets back fromtools/list(piT3McpExtensionSource.ts:272-280). So Codex, Pi and the others most likely show the full list too. Only the prompt text is gated: Codex drops the browser and device blocks (apps/server/src/provider/CodexDeveloperInstructions.ts:31-41), and Claude never gets the browser block.When it diverged#
#7083 originally withheld the whole credential, so the
t3-codeserver wasn't attached at all, and thesettings.tscomment was written for that version. #10839 (merged Sep 9) started issuing a credential every time, forpull-requests, and turnedpreviewinto a capability on it. Its own comment says this "withholds the preview tools without taking the server away". The comment atpackages/contracts/src/settings.ts:1299-1310was never updated. A day later, #10677 addedenableAgentDeviceAccesswith "the same way" wording (settings.ts:1344-1352). By then the gate was already capability-based, so it looks like the device tools were never hidden from the list. The orchestration and thread tools added since then mean the server now has to stay attached anyway.Impact#
Calls fail cleanly and tell the agent what to do instead, so the calls themselves appear to stay blocked. The cost is 18 tool definitions in every session with the settings off. There's also some mis-steering: Claude's T3 instructions say "When it exposes
preview_*tools, prefer those tools" (apps/server/src/provider/T3OrchestrationInstructions.ts:43), and those tools are listed, so it may try them before falling back.Possible fixes (not yet decided)#
tools/list(and refusetools/call) by the credential's capabilities inMcpHttpServer. One server-side change would cover every provider and outside MCP clients. I haven't checked whether Effect'sMcpServersupports filtering the list per request, so this may need a custom list handler or separate toolkit registration.disallowedToolsformcp__t3-code__preview_*/device_*, and Codex's per-server tool filter. This works but has to be repeated for every adapter.settings.tsdoc comments to describe the capability model.Related#
I didn't find a duplicate issue or an open PR that fixes this.