Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#141 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
75/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
node.js, typescript

Direzione di ricerca

Il bug si trova in packages/coding-agent/src/modes/rpc/rpc-mode.ts nella funzione handleInputLine. Inizia esaminando come analizza il JSON e lo converte in RpcCommand. La correzione consiste nel proteggersi da null prima di accedere a command.id, assicurandosi che venga emessa una risposta di errore invece di generare un'eccezione. Esegui il comando di riproduzione per verificare che la correzione mantenga il processo attivo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
54
Fork
20
Merge medio
4h 1m
PR unite (30g)
12

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di stepfun-ai/Step-Code

Tutte le issue di stepfun-ai/Step-Code

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.