RPC agent crashes (unhandled process exit) on a single `null` input line
维护者通常 1 天内回复
还没有人认领这个 Issue。
- #142 来自 @dangzitou —— 已关闭,未合并
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 75/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- node.js, typescript
调研方向
该错误位于 packages/coding-agent/src/modes/rpc/rpc-mode.ts 的 handleInputLine 函数中。首先检查它如何解析 JSON 并转换为 RpcCommand。修复方法是在访问 command.id 之前进行 null 防护,确保发出错误响应而不是抛出异常。运行复现命令以验证修复是否保持进程存活。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- TypeScript
- 星标
- 850
- 派生
- 62
- 平均合并
- 1 天 10 小时
- 30 天内合并 PR
- 51
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
stepfun-ai/Step-Code 的其他 Issue
-
area/build bug
难度 2/5 1-3 小时 新手友好度 75/100
stepfun-ai/Step-Code#190 · 2 条评论 ·
维护者通常 1 天内回复
-
area/tools bug
难度 2/5 1-3 小时 新手友好度 75/100
stepfun-ai/Step-Code#186 · 1 条评论 ·
维护者通常 1 天内回复
-
area/tools bug
难度 2/5 1-3 小时 新手友好度 75/100
stepfun-ai/Step-Code#185 · 1 条评论 ·
维护者通常 1 天内回复
-
area/tools bug
难度 2/5 1-3 小时 新手友好度 75/100
stepfun-ai/Step-Code#184 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
stepfun-ai/Step-Code#179 · 1 条评论 ·
维护者通常 1 天内回复
查看 stepfun-ai/Step-Code 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
jbacalso24/mimry#459 · 1 条评论 ·
维护者通常 1 天内回复
-
architecture help wanted hive/claimed-by-architect origin/architect stage/030-pr-in-progress tech-debt
难度 2/5 1-3 小时 新手友好度 78/100
kubestellar/console#24422 · 1 条评论 ·
维护者通常 1 天内回复
-
area: backends type: docs
难度 1/5 1-3 小时 新手友好度 83/100
schlessera/brain-kit#2383 ·
维护者通常 1 天内回复
-
agent duplicate providers tool triaged
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复