You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d2befa6
Browse filesBrowse the repository at this point in the historyBrowse files
MCP tool calls timed out after 20 seconds, the limit meant for the handshake. A slow but working tool (a browser navigation, a query, a build) returned mcp timeout while the server kept running it, and the agent would retry it. tools/call now waits up to 10 minutes and says so when it gives up (stub tool taking 21 s: timeout before, result after). The per-call timer is also cleared when the reply arrives, so a finished headless run no longer waits for it.
Copy file name to clipboardExpand all lines: darknode.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2048,7 +2048,7 @@ function mcpConnect(name, spec, cwd) {
2048
2048
let buf = "", idc = 0; const pending = Object.create(null); // null-proto: a server reply with id "__proto__"/"toString" can't resolve an inherited member (crash / silent mis-route)
2049
2049
cp.stdout.setEncoding("utf8"); cp.stdout.on("data", (d) => { buf += d; let nl; while ((nl = buf.indexOf("\n")) >= 0) { const line = buf.slice(0, nl); buf = buf.slice(nl + 1); if (!line.trim()) continue; let m; try { m = JSON.parse(line); } catch (_) { continue; } if (m && m.method) { if (m.id != null) { try { cp.stdin.write(JSON.stringify(m.method === "ping" ? { jsonrpc: "2.0", id: m.id, result: {} } : { jsonrpc: "2.0", id: m.id, error: { code: -32601, message: "method not found: " + m.method } }) + "\n"); } catch (_) {} } continue; } /* a request FROM the server (ping, roots/list) shares the id space: never route it to our pending call */ if (m.id != null) { const cb = pending[m.id]; if (typeof cb === "function") { delete pending[m.id]; cb(m); } } } });
ok("the MCP client answers server requests (ping) instead of routing them to its own pending call with the same id",/if\(m&&m\.method\)\{if\(m\.id!=null\)/.test(body)&&body.indexOf("if (m && m.method)")<body.indexOf("const cb = pending[m.id]"));}
3309
+
ok("the MCP client answers server requests (ping) instead of routing them to its own pending call with the same id",/if\(m&&m\.method\)\{if\(m\.id!=null\)/.test(body)&&body.indexOf("if (m && m.method)")<body.indexOf("const cb = pending[m.id]"));
3310
+
ok("an MCP tool call gets minutes, not the 20 s handshake limit, and its timer is cleared on reply",/srv\.call\("tools\/call",\{name:tool,arguments:a\},600000\)/.test(src)&&/pending\[id\]=\(m\)=>\(clearTimeout\(tm\),m\.error\)/.test(body)&&/tm=setTimeout\(/.test(body));}
0 commit comments