What happened?
A single line containing just null on stdin kills the whole RPC agent with an unhandled rejection, instead of returning an error response. Every other malformed line ([], 123, {}, "hi") is handled fine — only valid-JSON null is fatal:
$ printf 'null\n' | step --mode rpc
TypeError: Cannot read properties of null (reading 'id')
at handleInputLine (...)
Node.js v22.23.2 <- process exits
One bad line (from a client that emits a half-written frame, or any upstream producer) tears down the running session/daemon.
Steps to reproduce
printf 'null\n' | step --mode rpc
- Process exits non-zero with the TypeError above; it should stay up.
Root cause: packages/coding-agent/src/modes/rpc/rpc-mode.ts handleInputLine casts the parsed payload to RpcCommand and reads command.id in both handleCommand and the catch. On null the first read throws, then the catch reads command.id again and re-throws, escaping as an unhandled rejection.
Expected behavior
Emit an error response frame for that line and keep serving subsequent commands.
Version
0.84.4
I'd like to implement the fix myself.
What happened?
A single line containing just
nullon stdin kills the whole RPC agent with an unhandled rejection, instead of returning an error response. Every other malformed line ([],123,{},"hi") is handled fine — only valid-JSONnullis fatal:One bad line (from a client that emits a half-written frame, or any upstream producer) tears down the running session/daemon.
Steps to reproduce
printf 'null\n' | step --mode rpcRoot cause:
packages/coding-agent/src/modes/rpc/rpc-mode.tshandleInputLinecasts the parsed payload toRpcCommandand readscommand.idin bothhandleCommandand thecatch. Onnullthe first read throws, then the catch readscommand.idagain and re-throws, escaping as an unhandled rejection.Expected behavior
Emit an error response frame for that line and keep serving subsequent commands.
Version
0.84.4
I'd like to implement the fix myself.