Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở Phù hợp với người mới
#141 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

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ả

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.

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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của stepfun-ai/Step-Code

Tất cả issue của stepfun-ai/Step-Code

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.