Skip to content

[Bug]: tryHandleRootHelpFastPath sets process.exitCode but fails to terminate process, risking CLI hangs #97793

Description

@aniruddhaadak80

What Problem This Solves

When the CLI encounters an error displaying root help in the fast path, the error handler sets process.exitCode = 1 but does not explicitly call process.exit(1). Because it's a fast path that skips the main runtime teardown, any dangling promises, open file descriptors, or active timers will cause the Node event loop to stay open, hanging the CLI indefinitely instead of returning to the user's terminal.

Expected vs Actual Behavior

Expected: The error handler should explicitly terminate the process or ensure the event loop is fully drained.
Actual: It only sets the exit code, relying on a naturally empty event loop which is not guaranteed.

Code Link

https://github.com/openclaw/openclaw/blob/main/src/entry.ts#L155-L163

Proposed Solution

Update the error handler in deps.onError to explicitly call process.exit(1) after logging the error, or utilize the
untime.exit(1) standard.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions