Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

RPC agent crashes (unhandled process exit) on a single `null` input line

未关闭 适合新手
#141 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

  • #142 来自 @dangzitou —— 已关闭,未合并

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
75/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃

调研方向

该错误位于 packages/coding-agent/src/modes/rpc/rpc-mode.ts 的 handleInputLine 函数中。首先检查它如何解析 JSON 并转换为 RpcCommand。修复方法是在访问 command.id 之前进行 null 防护,确保发出错误响应而不是抛出异常。运行复现命令以验证修复是否保持进程存活。

由索引模型根据 Issue 内容生成。

描述

untriaged

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

  1. printf 'null\n' | step --mode rpc
  2. 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 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

stepfun-ai/Step-Code 的其他 Issue

查看 stepfun-ai/Step-Code 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。