Skip to content

fix: Propagate correct exit codes on signal termination (Unix)#24

Open
insign wants to merge 1 commit into
mainfrom
fix-signal-exit-codes-25870807027458885
Open

fix: Propagate correct exit codes on signal termination (Unix)#24
insign wants to merge 1 commit into
mainfrom
fix-signal-exit-codes-25870807027458885

Conversation

@insign

@insign insign commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

This PR improves the CLI's handling of processes that are killed by signals. It maps None exit codes to standard shell-compatible exit codes (128 + signal) on Unix platforms, allowing callers to correctly interpret termination causes (e.g., distinguishing between a clean failure exit 1 and a signal termination kill -9).

This is a valuable improvement for developers using run within automated scripts, system services, or continuous integration environments where reliable signal propagation is expected behavior.


PR created automatically by Jules for task 25870807027458885 started by @insign

When a child process terminates due to a signal (like SIGTERM or SIGKILL), `status.code()` returns `None` on Unix systems. Previously, `run` mapped this to a generic error code (1). This change checks for the termination signal via `ExitStatusExt` and computes the standard shell-compatible exit code (`128 + signal`), improving integrations with scripts, shells, and CI pipelines. On non-Unix platforms, it continues to return the generic error code.

Co-authored-by: insign <1113045+insign@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant