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
CI: investigate Ubuntu failure in TestStdioMCPTool #2
macOS and Windows passed in both attempts. The internal/agent package changed by #1 also passed on Ubuntu, and the PR does not modify internal/mcp.
On local Windows with Go 1.27.3, TestStdioMCPTool passed 50 consecutive runs. CI currently selects Go 1.25.x. WSL and Docker are unavailable locally, so an independent Linux reproduction is still needed.
Next step
Reproduce on Ubuntu with additional child-process exit diagnostics, then address the cause rather than repeatedly rerunning or skipping the test. It is not yet established whether this is a test-only race or a stdio client lifecycle bug.
The cause is a race in the stdio client, not in the test. Call closed its done channel before its caller cancelled the request context. When the watcher goroutine was scheduled after both were ready, Go's select could pick the cancellation branch and kill the shared MCP server process even though that request had already completed. The next request then failed with MCP server closed stdio — exactly the symptom in the log.
context.AfterFunc in #3 removes it: the callback is unregistered before Call returns, so a completed request can never take the cancellation branch. The regression test in that PR reproduces the original failure (244 of 1000 completed-call cycles on the old client) and passes on the new one.
Activity
Balanov commentedon Nov 13, 2026
Resolved, and it was not a test race.
The cause is a race in the stdio client, not in the test.
Callclosed itsdonechannel before its caller cancelled the request context. When the watcher goroutine was scheduled after both were ready, Go'sselectcould pick the cancellation branch and kill the shared MCP server process even though that request had already completed. The next request then failed withMCP server closed stdio— exactly the symptom in the log.context.AfterFuncin #3 removes it: the callback is unregistered beforeCallreturns, so a completed request can never take the cancellation branch. The regression test in that PR reproduces the original failure (244 of 1000 completed-call cycles on the old client) and passes on the new one.Closing this in favour of #3.