Commit Graph

3 Commits

Author SHA1 Message Date
maweibin
84cd3aa7f5 fix(cli): call process.exit(1) in root help and version fast path error handlers (#97793) (#97807)
The error handler in tryHandleRootHelpFastPath only set process.exitCode=1
without calling process.exit(). When dangling async handles exist (timers,
connections, promises), the Node event loop stays open and the CLI hangs
indefinitely instead of returning to the terminal.

In tryHandleRootVersionFastPath, the default onError handler called
process.exit(1) directly, bypassing the injected exit seam that the
success path already uses. Changed to exit(1) (deps.exit ?? process.exit)
so tests and embedded callers can observe and control exit on failure.

Added rejection-path tests for version fast path: injected exit called
on resolveVersion rejection, and caller-supplied onError honored.

Fixes #97793.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 10:47:55 -07:00
Peter Steinberger
c1aa424d6b docs: document src root entry helpers 2026-06-04 02:45:34 -04:00
Peter Steinberger
8e519aa826 perf(test): slim entry and chat tests 2026-04-20 19:55:44 +01:00