Skip to content

Treat SIGHUP like SIGINT and SIGTERM - #25

Merged
JacobStephens2 merged 2 commits into
mainfrom
issue-24
Sep 25, 2026
Merged

JacobStephens2 merged 2 commits into
mainfrom
issue-24

Conversation

@JacobStephens2

Copy link
Copy Markdown
Owner

Summary

A closed terminal now interrupts a Run the same way Ctrl-C does: the agent session is stopped, the Run goes through the Failed run path, and the plugin temp dir is removed.

 interrupt::install()
-  for signal in [SIGINT, SIGTERM]
+  for signal in [SIGINT, SIGTERM, SIGHUP]
     register(signal, REQUESTED)

Evidence

New test sighup_while_the_session_runs_stops_it_and_fails_the_run uses the shared assert_interrupt_fails_the_run. That assertion requires the Run to finish in under 20s, the Issue branch on origin to have the thirdshift: failed run (interrupted) commit with wip.txt, and the scenario's tmp/ to be empty. The tmp/ check already runs for all three signals, via assert_failed → assert_cleaned_up.

  • Before: panicked at tests/failed_run.rs:185:5: the session was not stopped (the fake agent ran its full sleep 30)
  • After: cargo test: all suites pass, failed_run 9/9

Merge Danger

Door: two-way

A revert restores the old behaviour.

Blast Radius: small

A Run whose terminal closes no longer dies immediately. It stops the agent session and pushes a failure commit, just as it does on SIGINT and SIGTERM.

Unaddressed findings

Standards

  • Possible Shotgun Surgery. The signal list appears in the module doc, the install() doc, and the array. I kept it that way: the spec asks for the module doc to name the handled signals, and a list of three changes rarely.

Spec

  • README wording ("Ctrl-C or a closed terminal") goes slightly beyond the spec. I kept it because it only documents the new behaviour and doesn't change semantics.

Closes #24

🤖 Generated with Claude Code

JacobStephens2 and others added 2 commits September 25, 2026 13:43
A closed terminal killed thirdshift on the spot, leaving the agent
session running, the plugin temp dir behind, and no failure commit.
SIGHUP now sets the interrupt flag, so the Run goes through the Failed
run path and cleans up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

A thirdshift-plugin-* temp dir can outlive its Run

1 participant