Repository navigation
Description
Summary
In a Claude agent session, openBrowserPage called without forceNew while an unshared tab on the same URL is open asks "Share an existing browser tab?". Choosing Yes, share makes the tool fail with Page "<id>" not found. The agent receives only Unknown error.
Reproduced 2/2.
Steps
- Open
http://localhost:3005/in the integrated browser, share it with the agent, then click Stop Sharing with Agent. The tab stays open. - In a Claude agent session, have the agent call
openBrowserPage({ "url": "http://localhost:3005/" })with noforceNew. - The "Share an existing browser tab?" question appears inline. Choose Yes, share "VdoCard — …" and submit.
Expected
The tool returns the shared page's snapshot, as it does when called with forceNew: true.
Actual
The tab shows "Sharing with Agent", but the tool call fails:
11:41:01.132 [info] [AgentHost] Running client tool: openBrowserPage (callId=toolu_01T4brAHwyoiRx36oJdudutZ, withContext=true)
11:41:43.894 [error] [LanguageModelToolsService#invokeTool] Error from tool open_browser_page with parameters {"url":"http://localhost:3005/"}:
Page "d9bce5c8-7e9b-42fc-ba69-08858685a0df" not found: Error: Page "d9bce5c8-7e9b-42fc-ba69-08858685a0df" not found
at RC._getPage (.../sharedProcess/sharedProcessMain.js:373:3059)
at async RC._getSummary (.../sharedProcess/sharedProcessMain.js:373:1289)
11:41:43.901 [warning] [AgentHost] Client tool failed: openBrowserPage Page "d9bce5c8-7e9b-42fc-ba69-08858685a0df" not found
(window1/renderer.log. The 42 s gap is the user waiting before answering. In the first run the call failed 11 s after it started, with the same error.)
Right after the failure, readPage({ pageId: "d9bce5c8-…" }) succeeds and returns the full snapshot. The page exists, so _getSummary appears to run before the re-shared page is registered on the Playwright side.
Second problem: the error never reaches the agent
The agent's tool result is the string Unknown error, and the Page … not found message is lost. The agent cannot tell a failed share from a closed tab, and it guesses wrong. PR #330709 ("Surface a client tool's error when it returns no content") targeted this and was closed without merging. It still reproduces on 1.141.0.
Environment
- VS Code 1.141.0 (commit 2a59476), macOS 27.0.1 arm64, local window
- Agents window, built-in Claude agent (session type
agent-host-claude), permission mode Bypass Permissions - Claude Agent SDK 0.3.281 (
@anthropic-ai/claude-agent-sdk-darwin-arm64, CLI2.1.281 (Claude Code)), run from~/.local/share/vscode-claude-sdk - Signed in with a Claude subscription (Claude.ai login). No Anthropic API key and no GitHub Copilot subscription are involved.
workbench.browser.enableChatTools: trueagentHostMain.jsis locally patched. The patches turn native-model vision back on (Claude agent host: native (Anthropic-auth) models hardcode supportsVision:false, so image paste is rejected #337631), re-allow Claude's WebSearch (Claude agent host: native (Anthropic-auth) sessions have WebSearch disabled by the CAPI-only disallowedTools block #337886), and default AskUserQuestion'sallowFreeformInputto true (Claude in the chat window doesn't show free text option when display decision choices #335933). None of them touch the browser tools or the client-tool path.
Related
- Browser client tools never return: completions forwarded with source=client-dispatch are never delivered to the pending tool_use #335378, Integrated browser MCP tool calls always aborted with "interrupted before a result was received" #335400: browser client tool calls that never return. In the same session, earlier
openBrowserPagecalls hung for 5 minutes and ended with "The tool call was interrupted before a result was received." - Agent Host:浏览器重连/会话恢复后工具从 No client connected 变为 does not exist,旧共享页失效 #340718: a shared page becomes invalid after reconnect. The symptom is different, and no reconnect happened here.
Activity
Wait for page discovery after sharing an existing browser tab (#346638)
Wait for page discovery after sharing an existing browser tab
Wait for page discovery after sharing an existing browser tab
Wait for page discovery after sharing an existing browser tab
Wait for page discovery after sharing an existing browser tab