t3code icon indicating copy to clipboard operation
t3code copied to clipboard

Claude sessions released after 2 min idle restart stdio MCP servers, re-prompting chrome-devtools-mcp autoConnect consent

Open vstratful opened this issue 4 days ago • 0 comments

What happened

Since updating to v0.1.12+, the user's chrome-devtools-mcp server (stdio, --autoConnect to their real Chrome profile) keeps "timing out", and Chrome asks them to approve remote debugging again and again during normal use of a single thread.

Diagnosis

PR #41174 (first shipped in v0.1.12) lowered DEFAULT_IDLE_TIMEOUT_MS from 30 min to 2 min for providers with native resume (apps/server/src/orchestration-v2/ProviderSessionManager.ts:81). When a Claude session is released, its CLI process and every stdio MCP server it spawned get SIGINT/SIGTERM. On the next turn, a new CLI starts new MCP processes.

For stateless MCP servers this costs about a second. For servers that hold a connection with user consent behind it, it is a regression. chrome-devtools-mcp --autoConnect (Chrome 144+) makes Chrome show an "Allow remote debugging?" prompt for every new client connection. So after every pause of more than 2 minutes, the next browser tool call blocks on a new consent prompt. If the user doesn't click Allow within 60 s, the call fails with timed out after 60000ms waiting for the browser connection to be established.

The timeout is a hardcoded constant. ProviderSessionManager.layer is built without options in runtimeLayer.ts, so users can't raise it. main still has the 2-minute value.

The PR's own trade-off ("the cost is starting the provider process again, about a second") doesn't account for side effects in MCP children: lost browser/CDP connections, consent prompts, warm caches, long-lived subprocesses started by MCP servers.

Steps to reproduce

  1. Chrome 144+ on the host, with remote debugging enabled at chrome://inspect/#remote-debugging.
  2. Configure Claude Code with a user-scoped stdio MCP server: npx -y chrome-devtools-mcp@latest --autoConnect.
  3. In a T3 Code Claude thread, ask for a browser action (for example "list my open tabs"), then click Allow when Chrome prompts.
  4. Wait more than 2 minutes with the thread idle.
  5. Ask for another browser action. Chrome prompts again. Ignore the prompt and the tool call fails after 60 s.

On v0.1.11 the second prompt only appears after 30 minutes idle.

Version

T3 Code v0.1.13 (server and desktop). Regression introduced in v0.1.12 by #41174.

Environment

  1. Server: Linux x64 (WSL2, kernel 6.6.87.2-microsoft-standard-WSL2), Node v26.13.1, server started by T3 Code Desktop 0.1.13 on Windows.
  2. Claude Code 2.1.332.
  3. chrome-devtools-mcp 1.14.0, --autoConnect to Windows Chrome via WSL mirrored networking.

Evidence

Server trace ProviderSessionManager.releaseIfStillIdle spans line up to the second with the Claude Code MCP log for the chrome-devtools server, all within one Claude session:

trace   22:24:41 ProviderSessionManager.releaseIfStillIdle
mcp-log 22:24:41 Sending SIGINT to MCP server process
mcp-log 22:24:41 STDIO connection closed after 1441s (cleanly)
mcp-log 22:24:43 Starting connection ...            <- new process, new Chrome consent
trace   22:27:17 ProviderSessionManager.releaseIfStillIdle
mcp-log 22:27:17 Sending SIGINT to MCP server process
mcp-log 22:27:18 Starting connection ...

MCP process spawns per Claude session (from Claude Code's per-server MCP logs):

2026-11-11..20 (v0.1.11 and earlier)  ~1.0-1.3 spawns/session
2026-11-25 (v0.1.12)                   3.5 spawns/session
2026-11-27 (v0.1.13)                   5.3 spawns/session

Failures when the prompt isn't answered in time:

Tool "new_page" timed out after 60000ms waiting for the browser connection to be established. The connection attempt will be retried automatically on the next tool call.

Related issues

  1. #41174: the PR that introduced the 2-minute release.
  2. #44047: chrome-devtools-mcp startup in Codex threads (per-thread env breaks Codex's lazy-start cache). Same MCP server but a different mechanism, not a duplicate.
  3. #41700: Antigravity idle release kills a background run_command. Same idea (idle release kills long-lived children), different provider.

Suggested direction

Any of these would fix it:

  1. Make the idle timeout a user setting, per provider or global.
  2. Keep a session alive longer, or don't release it, when its provider has stdio MCP servers configured. At minimum, go back to the 30-minute timeout in that case.
  3. Document that stdio MCP servers are restarted after 2 minutes idle, so users with stateful servers know to run them as shared HTTP servers.

Fix applied or workaround

Nothing in T3 Code was changed. The user now runs one long-lived chrome-devtools-mcp behind mcp-proxy as a systemd user service (127.0.0.1, bearer-token auth) and points Claude Code at it as an http MCP server. The Chrome connection survives Claude process restarts, so consent is asked once per Chrome restart. Trade-offs: all threads share one browser session, and file-path tools are limited to the temp dir because the proxy doesn't forward MCP roots.

Filed by

Claude Code (claude-opus-5-5) running the T3 Code triage playbook.

vstratful avatar Nov 27 '26 22:11 vstratful