Skip to content

Serialize signal scope retirement with signal receipt - #4609

Merged
max-sixty merged 5 commits into
mainfrom
codex/signal-scope-retirement
Oct 27, 2026
Merged

max-sixty merged 5 commits into
mainfrom
codex/signal-scope-retirement

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

A final alias child can catch Ctrl-C and exit successfully before wt's signal-owning thread finishes handling its SIGINT. Retiring the final foreground scope on another thread can restore idle default handling during that receipt, killing wt instead of preserving the child's exit status.

Retire foreground scopes on the existing process owner, which already serializes signal receipt with child admission. Add a controlled regression that pauses receipt while a real child handles Ctrl-C and exits successfully, cover nested owner requests and panic propagation, and preserve exit status and stderr in the alias test's failure diagnostic.

Includes the receipt handshake from #4607: the alias test keeps its child alive until wt records receiving SIGINT. This separates an interrupt received during the command from one that arrives after the child has exited. The controlled unit regression independently exercises teardown during an already-entered handler.

The regression fails against main and passes with the fix on Linux and macOS. Validation: full project gate (5,442 tests passed, one skipped), Linux signal/process-owner tests, and all 91 Linux alias tests.

Fixes #4603.

This was written by Codex on behalf of max-sixty

worktrunk-bot
worktrunk-bot previously approved these changes Oct 27, 2026
@worktrunk-bot

Copy link
Copy Markdown
Collaborator

Codecov's patch check failed at 94.77% against the 98.60% target. Its compare report shows five misses in the regression test's failure diagnostics and polling loop, plus two in process_owner::run (the owner-thread path and panic rethrow). The owner-runner paths are useful to exercise, but covering those two lines alone would still leave the patch below target. Under AGENTS.md → Coverage, a failing patch check needs explicit maintainer approval before merge. I’m clearing my approval pending that decision or a green check.

@worktrunk-bot
worktrunk-bot dismissed their stale review October 27, 2026 02:31

Codecov patch check failed at 94.77%; AGENTS.md requires explicit approval before merging with failing patch coverage.

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The alias test still has the receipt race addressed by #4607. These PRs edit the same test, so their test changes need to be reconciled before this assertion is used as evidence for the fix.

Comment thread tests/integration_tests/step_alias.rs Resolved
@max-sixty
max-sixty merged commit d697e94 into main Oct 27, 2026
40 checks passed
@max-sixty
max-sixty deleted the codex/signal-scope-retirement branch October 27, 2026 04:08
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.

ci-fix: Linux signal alias test intermittently exits unsuccessfully

2 participants