Repository navigation
fix(cli): prevent startup metadata hangs after root-help timeouts - #109417
Conversation
6ce5b93 to
970fe8d
Compare
|
Codex review: needs maintainer review before merge. Reviewed July 17, 2026, 2:27 AM ET / 06:27 UTC. Summary PR surface: Tests +27, Other +2. Total +29 across 2 files. Reproducibility: yes. The production path uses Review metrics: none identified. Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Both synchronous root-help renderers should enforce their existing deadline with an uncatchable kill signal, while asynchronous command-help rendering retains its graceful process-tree shutdown sequence. Do we have a high-confidence way to reproduce the issue? Yes. The production path uses Is this the best way to solve the issue? Yes. Configuring the existing synchronous subprocess timeout with SIGKILL is the narrowest maintainable repair; it avoids duplicating the more complex asynchronous process-tree supervisor and preserves normal help output. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8fa4867ab43b. Label changesLabel justifications:
Evidence reviewedPR surface: Tests +27, Other +2. Total +29 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
970fe8d to
c41fd5c
Compare
|
Merged via squash.
|
Co-authored-by: wahaha1223 <[email protected]>
Co-authored-by: wahaha1223 <[email protected]>
What Problem This Solves
Fixes an issue where CLI startup metadata generation, builds, and packaging could remain blocked after the 120-second root-help rendering timeout when the renderer intercepted and ignored the default termination signal.
Why This Change Was Made
Both synchronous root-help render paths now use
SIGKILLwith their existing timeout so the deadline is a hard bound. The change is limited to the bundled and source root-help subprocesses; the asynchronous command-help renderer keeps its existing TERM-to-KILL process-tree lifecycle.User Impact
Developers and release operators no longer have to manually terminate metadata generation when a root-help renderer stalls past its timeout. Normal bundled and source help output is unchanged.
Evidence
Real-machine proof was collected on Linux 6.8.0 x86_64 with Node v24.18.0.
Before the production change, the focused test drove both real renderer entry points through a partial
node:child_processmock and failed because their exact spawn options hadtimeout: 120000but no hard kill signal:The underlying Node behavior was reproduced with real child processes. The child intercepted
SIGTERMand exited on its own after two seconds; the caller requested a 100 ms timeout:This matches the Node
spawnSynccontract:killSignaldefaults toSIGTERM, and the synchronous call continues waiting if the child handles that signal without exiting: https://nodejs.org/api/child_process.html#child_processspawnsynccommand-args-optionsAfter the change, the same focused test confirms both production render paths pass
timeout: 120000andkillSignal: "SIGKILL":The real source root-help renderer also completed normally as a production-path negative control:
Additional validation:
Autoreview (
.agents/skills/autoreview/scripts/autoreview --mode uncommitted --stream-engine-output) reported no findings andpatch is correctwith 0.94 confidence.Not tested locally: a full bundled build/package run or Windows execution. The regression test covers the exact options for both synchronous entry points; fork CI will provide the broader build and platform-independent checks.
AI-assisted: Codex helped implement and review the change; the real subprocess and production renderer evidence above was run locally.