[bug] On Windows, runCommandHook in LIFEOS/CODEX/Bridge.ts does not stop at the hook…

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

I maintainer di solito rispondono entro 6 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
74/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
bun, typescript
Ambito
cli

Direzione di ricerca

Inizia da runCommandHook in LIFEOS/CODEX/Bridge.ts e leggi il gestore del timeout insieme al listener close che attualmente decide quando la promise viene risolta. Riproduci passando un hook SessionStart di sleep 8 con timeout: 2 tramite bridge() via deps.settings e cronometrando la chiamata. La correzione è quella del reporter: su win32, esegui taskkill /PID <child.pid> /T /F mentre il collegamento parent esiste ancora, poi risolvi come timeout senza attendere close. Fatto significa che il bridge ritorna vicino al timeout su Windows e nessun processo figlio viene lasciato indietro.

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

Descrizione

What happened

On Windows, runCommandHook in LIFEOS/CODEX/Bridge.ts does not stop at the hook timeout. The timer kills Git sh.exe, but the hook child process (bun, sleep) keeps running and holds the stdout and stderr pipes, so the close event fires only when the child ends and the bridge waits with it. Measured: a hook running sleep 8 with timeout 2 took 8.1 s. A local patch fixed it: on win32, run taskkill /PID /T /F before child.kill and resolve as timed out (2.1 s with sleep 60, no leftover processes).

Summary

On Windows, killing the hook's sh.exe does not kill the process it started, and that child keeps the pipes open, so runCommandHook resolves only when the child exits on its own. A hung hook holds the Codex bridge past its timeout, up to Codex's own hook timeout.

Repro: a SessionStart hook sleep 8 with timeout: 2 passed to bridge() through deps.settings takes about 8 s instead of about 2 s.

Fix that worked locally: in the timeout handler, on win32 run taskkill /PID <child.pid> /T /F before child.kill() (while the parent link still exists), then resolve as timed out without waiting for close. With sleep 60 and timeout: 2 the bridge returned in 2.1 s and no sleep process was left.

Details

  • Kind: bug
  • LifeOS version: 8.761.0

Filed with the LifeOS /feedback command. The reporter approved this exact text before it was sent; paths, secrets and personal details were stripped locally.

Lingua principale
TypeScript
Stelle
19.8k
Fork
2.5k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 danielmiessler/LifeOS

Tutte le issue di danielmiessler/LifeOS

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.