Skip to content

fix(run): improve recovery path for SIGTERM/SIGINT interruptions#303

Merged
RyderFreeman4Logos merged 2 commits intomainfrom
fix/run-signal-resume-guidance
Mar 1, 2026
Merged

fix(run): improve recovery path for SIGTERM/SIGINT interruptions#303
RyderFreeman4Logos merged 2 commits intomainfrom
fix/run-signal-resume-guidance

Conversation

@RyderFreeman4Logos
Copy link
Owner

@RyderFreeman4Logos RyderFreeman4Logos commented Mar 1, 2026

Summary

  • attach meta_session_id context to pipeline transport errors after session creation
  • treat SIGTERM/SIGINT as explicit interruption outcomes in csa run (exit 143/130), instead of generic fatal errors or fallback retries
  • emit deterministic resume hints (text + JSON) so long-running --skill workflows can be resumed with the exact session id
  • add focused unit tests for interruption detection, session id extraction, and resume command rendering

Verification

  • just fmt
  • just clippy
  • just test

Fixes #302

@RyderFreeman4Logos RyderFreeman4Logos merged commit 7c500ee into main Mar 1, 2026
6 checks passed
@RyderFreeman4Logos RyderFreeman4Logos deleted the fix/run-signal-resume-guidance branch March 1, 2026 12:50
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b66386dab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +614 to +617
cleanup_pre_created_fork_session(
&mut pre_created_fork_session_id,
&project_root,
);

Choose a reason for hiding this comment

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

P1 Badge Preserve fork session before emitting interruption resume hint

This interruption branch deletes pre_created_fork_session_id before returning the resume guidance, but native fork runs use that pre-created ID as the active session (effective_session_arg) and execute_transport_with_signal persists interruption state into it. In a SIGINT/SIGTERM during a native fork, the code can print a --session <id> hint for the same ID it just deleted, so resume immediately fails because the referenced session no longer exists.

Useful? React with 👍 / 👎.

Comment on lines +858 to +862
if message.contains("sigterm") {
return Some(143);
}
if message.contains("sigint") {
return Some(130);

Choose a reason for hiding this comment

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

P2 Badge Restrict signal detection to real interruption errors

The new classifier treats any error-chain message containing sigterm/sigint as an interruption, which can misclassify non-interruption failures (for example, signal-handler setup errors like Failed to register SIGINT handler from execute_transport_with_signal) as exit 130/143. In that case users get an "interrupted" response and fallback/error handling is skipped even though no OS signal interrupted execution.

Useful? React with 👍 / 👎.

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.

pr-codex-bot can be externally SIGTERM-killed (~22m) without auto-resume, leaving partial state

1 participant