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
RPC agent crashes (unhandled process exit) on a single null input line #141
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.tshandleInputLine 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.
This issue was auto-closed. All issues from new contributors are auto-closed by default.
Maintainers review auto-closed issues daily and reopen worthwhile ones. Issues that do not meet the quality bar in CONTRIBUTING.md will not be reopened or receive a reply.
If a maintainer replies lgtmi on one of your issues, your future issues will stay open. If a maintainer replies lgtm, your future issues and PRs will stay open. The command must be at the start of the reply (optionally after one or more @username mentions) or at the end.
Follow-up: the fix is ready and now rebased onto current main. The original PR #142 was auto-closed minutes after opening by the contributor gate, which has since been removed from main (#152).
Branch: dangzitou/Step-Code → fix/rpc-null-line-crash @ dee0e99 — a single commit, 11 lines in packages/coding-agent/src/modes/rpc/rpc-mode.ts. It guards null / non-object parsed payloads before the RpcCommand cast and emits the same error response frame other malformed input already produces, so a lone null line can no longer kill the RPC agent. Verified on current main with the existing RPC suites and the exact repro from this issue (before: uncaught TypeError, non-zero exit; after: error frame, exit 0 on stdin EOF). The bug is still present on main.
Opening a fresh PR from the same rebased branch fails with "dangzitou does not have the correct permissions to execute CreatePullRequest" (fork PRs from this account worked as recently as yesterday, e.g. fix: isolate sessions by header cwd #157).
If the branch looks right, could someone open the PR from it, or let me know how you'd like to proceed? Happy to adjust the message shape or squash it.
I’ll pick this up from @dangzitou’s unmerged fix in #142. I’ve reproduced the crash on current main and verified the guard with sequential and same-chunk JSONL inputs, plus the real RPC process. I’m consolidating the commits and doing a final diff review before reopening #308.
Activity
github-actions commentedon Sep 22, 2026
This issue was auto-closed. All issues from new contributors are auto-closed by default.
Maintainers review auto-closed issues daily and reopen worthwhile ones. Issues that do not meet the quality bar in CONTRIBUTING.md will not be reopened or receive a reply.
If a maintainer replies
lgtmion one of your issues, your future issues will stay open. If a maintainer replieslgtm, your future issues and PRs will stay open. The command must be at the start of the reply (optionally after one or more@usernamementions) or at the end.See CONTRIBUTING.md.
fix: reject null RPC command instead of crashing the agent
dangzitou commentedon Sep 24, 2026
Follow-up: the fix is ready and now rebased onto current
main. The original PR #142 was auto-closed minutes after opening by the contributor gate, which has since been removed from main (#152).Branch:
dangzitou/Step-Code→fix/rpc-null-line-crash@dee0e99— a single commit, 11 lines inpackages/coding-agent/src/modes/rpc/rpc-mode.ts. It guardsnull/ non-object parsed payloads before theRpcCommandcast and emits the same error response frame other malformed input already produces, so a lonenullline can no longer kill the RPC agent. Verified on current main with the existing RPC suites and the exact repro from this issue (before: uncaught TypeError, non-zero exit; after: error frame, exit 0 on stdin EOF). The bug is still present on main.I can't land it myself right now:
CreatePullRequest" (fork PRs from this account worked as recently as yesterday, e.g. fix: isolate sessions by header cwd #157).If the branch looks right, could someone open the PR from it, or let me know how you'd like to proceed? Happy to adjust the message shape or squash it.
fix: reject null RPC command instead of crashing the agent
fix: reject null RPC command instead of crashing the agent
li-xiu-qi commentedon Oct 26, 2026
I’ll pick this up from @dangzitou’s unmerged fix in #142. I’ve reproduced the crash on current main and verified the guard with sequential and same-chunk JSONL inputs, plus the real RPC process. I’m consolidating the commits and doing a final diff review before reopening #308.
fix(coding-agent): reject null RPC commands instead of crashing
fix(coding-agent): reject null RPC commands instead of crashing