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
McpServer.layerStdio drops in-flight responses when stdin closes #8710
RpcServer.makeProtocolStdio interrupts the server fiber as soon as stdin ends (Effect.ensuring(... Fiber.interrupt(fiber)), packages/effect/src/rpc/RpcServer.ts ~L1395 on main). Responses to requests that were already read but have not finished are never written. A client that writes its requests and then closes stdin, such as a one-shot shell pipeline or a test harness, gets partial output or none. The process also exits with 130 (interrupted) on an ordinary EOF.
Reproduction (effect 4.0.0, @effect/platform-node 4.0.0, Node 24.16 and Bun 1.4.2):
node server.ts < frames.jsonl # only the initialize response, exit 130
(cat frames.jsonl; sleep 1) | node server.ts # initialize and tools/call responses, exit 130
On Bun the first command prints nothing, not even the initialize response.
Expected: after EOF the server finishes the requests it has already read and writes their responses, then exits 0. A bounded grace period would be fine.
Workaround: wrap Stdio so stdin stays open after EOF until each request id read from it has a response on stdout or a notifications/cancelled, up to a timeout.
Activity