bug: RpcClient.start reports success after a signal exit during startup

Aperta Adatta ai principianti
#128 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

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
Ambito
backend, cli, testing

Direzione di ricerca

Il bug si trova nel metodo RpcClient.start() in packages/coding-agent/src/modes/rpc/rpc-client.ts. Crea uno script figlio di test minimale che chiami process.kill(process.pid, "SIGTERM"). Usalo per riprodurre il problema istanziando il client e chiamando start(). La correzione dovrebbe controllare exitError e l'uscita per segnale in aggiunta a exitCode. Esegui la suite di test esistente con npm run check e ./test.sh per assicurarti che la regressione passi dopo la correzione.

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

Descrizione

untriaged
What happened?

RpcClient.start() resolves successfully when its child terminates with SIGTERM during the startup delay. A caller can therefore treat a dead agent as ready. The startup check only examines exitCode, which is null for a signal exit; the exit handler has already recorded the failure in exitError.

This is a reliability bug, not a security vulnerability. A small local fix checks the recorded error and signal exit as well. May I have lgtm approval to submit it with regression tests?

Steps to reproduce

On macOS, create a temporary child.mjs containing:

process.kill(process.pid, "SIGTERM");

Instantiate RpcClient from packages/coding-agent/src/modes/rpc/rpc-client.ts with cliPath pointing to that file, then await client.start(). It resolves rather than rejecting. The reproduction launches only this minimal Node child, not StepCode or any extensions.

Expected behavior

Reject startup with Agent process exited (code=null signal=SIGTERM) when the child has already terminated. The regression fails before the fix and passes afterward. Local npm run check and ./test.sh passed with Node 22, pnpm 9.15.9, and rg/fd available on PATH.

Version

main at b2dacb6d9e297f3c9931c1adbdc9d6e1e97ef048, macOS arm64.

Lingua principale
TypeScript
Stelle
1k
Fork
71
Merge medio
13h 14m
PR unite (30g)
66

Preparare l'ambiente

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.