RPC agent crashes (unhandled process exit) on a single `null` input line
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 75/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
- Lĩnh vực
- backend-api-design, cli
Hướng nghiên cứu
Lỗi nằm trong packages/coding-agent/src/modes/rpc/rpc-mode.ts trong hàm handleInputLine. Hãy bắt đầu bằng cách kiểm tra cách nó phân tích JSON và ép kiểu sang RpcCommand. Cách sửa là bảo vệ chống lại null trước khi truy cập command.id, đảm bảo phát ra phản hồi lỗi thay vì ném ngoại lệ. Chạy lệnh tái tạo để xác minh rằng bản sửa lỗi giữ cho tiến trình tiếp tục chạy.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 54
- Fork
- 20
- Merge trung bình
- 4 giờ 1 phút
- Pull request đã merge (30 ngày)
- 12
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của stepfun-ai/Step-Code
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
stepfun-ai/Step-Code#190 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
stepfun-ai/Step-Code#186 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
stepfun-ai/Step-Code#185 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
stepfun-ai/Step-Code#184 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
stepfun-ai/Step-Code#179 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của stepfun-ai/Step-Code
Issue tương tự
-
Resources: New palettes of MacaoĐang mởresources
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
railmapgen/rmg-palette#2445 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
danielmiessler/LifeOS#2242 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
good first issue hacktoberfest help wanted translation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
callstackincubator/appduct#129 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100