Skip to content

Comments

fix(cli): Replace process.exit(130) with thrown error for graceful cleanup#213

Draft
dcramer wants to merge 1 commit intomainfrom
warden-sweep/cd745cc3/bf627437
Draft

fix(cli): Replace process.exit(130) with thrown error for graceful cleanup#213
dcramer wants to merge 1 commit intomainfrom
warden-sweep/cd745cc3/bf627437

Conversation

@dcramer
Copy link
Member

@dcramer dcramer commented Feb 23, 2026

Replaces direct process.exit(130) in readSingleKey() with a thrown UserAbortError, allowing Sentry spans to complete and telemetry to flush before exit.

readSingleKey() captures Ctrl+C as raw byte \x03 (stdin in raw mode), bypassing the SIGINT handler entirely. The immediate process.exit(130) skipped span completion, log cleanup, and flushSentry(). Now callers can catch UserAbortError and exit gracefully.

Automated fix for Warden finding find-warden-bugs-bf627437 (high, detected by find-warden-bugs).

Ref #212

This PR was auto-generated by a Warden Sweep (run cd745cc3).
The finding has been validated through automated deep tracing,
but human confirmation is requested as this is batch work.

@dcramer dcramer added the warden Automated fix from Warden Sweep label Feb 23, 2026
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

…eanup

readSingleKey() called process.exit(130) on Ctrl+C, bypassing Sentry span
completion and telemetry flush. Throw UserAbortError instead, allowing
callers to clean up before exiting.

Warden finding find-warden-bugs-bf627437
Severity: high

Co-Authored-By: Warden <noreply@getsentry.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

warden Automated fix from Warden Sweep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant