Repository navigation
MCP client has no initialize timeout: a hung stdio server blocks the agent indefinitely (and startup failures are silent) #13653
Yijian-quiet
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Environment: dsh
0.2.1-rc.5, Node v24.21, Linux. Reproduced with the headless profile on a scratchDSH_HOME(no real sessions touched).Summary
Two reproducible problems in
@deepseek-ai/dsh-mcp-client:initializehandshake. A stdio server that spawns but never answers blocks plugin loading forever — the agent never replies, and nothing is logged.failOnStartupError: false(the default), a server that crashes leaves its tools unregistered, and neither the UI nor the log says so.Reproduction
Profile patch (scratch
DSH_HOME):Control — same config with
command: 'false'(exits immediately):Where it comes from
node_modules/@deepseek-ai/dsh-mcp-client/lib/index.js:createTransport()(~L38):new StdioClientTransport({ command, args, env, cwd })— no timeout option.connectGeneration()(~L643):await generation.connect(transport)— no timeout, noAbortSignal.apply()(~L832):const outcome = await connection.ready;— plugin loading awaits the first attempt, so a hung handshake never completes.failOnStartupErrordefaults tofalse(~L789/L798): failures unregister the tools and continue, but with no observable state.RECONNECT_DEFAULTS(~L434): 10 attempts, 500 ms → 30 s backoff — fine on its own; the un-timed firstconnect()is the blocker.Impact
The host looks healthy (HTTP up, model calls work), but the assistant is mute. That is what users hit here on 2026-11-18:
dsh webwas listening on:3080the whole time, and the only errors inweb.logwere 12 crashes of a Python MCP server (rdkitbuilt against NumPy 1.x running on NumPy 2.2 →_ARRAY_API not foundat import). The crash-loop variant degrades silently; the hung variant is strictly worse.Suggested fix
connectTimeoutMs(e.g. 10 s) and pass anAbortSignaltogeneration.connect(); on timeout, treat it as a startup failure and let the existing background retry continue.unavailable+ reason) through the status/health API and a visible hint in the UI, instead of "no tools, no message".Happy to test a patch — both variants reproduce in seconds here.
All reactions