fix(hooks): detach daemon from spawning session so terminal SIGHUP can't kill it mid-run#87
Open
titothedeveloper wants to merge 1 commit into
Open
fix(hooks): detach daemon from spawning session so terminal SIGHUP can't kill it mid-run#87titothedeveloper wants to merge 1 commit into
titothedeveloper wants to merge 1 commit into
Conversation
The daemon is started lazily by whichever Claude Code session's hook fires first. If that terminal closes mid-run (engineer closes the tab), the resulting SIGHUP kills the daemon and wipes its in-memory cross-session team map — breaking agent-teams nesting for every still-running specialist. nohup makes the daemon ignore SIGHUP; disown detaches it from the shell's job table. macOS has no setsid, so nohup+disown is the portable detach. The daemon still self-reaps via its inactivity timeout, so it won't linger. Split out of #86 per review (separate concern from the daemon-side fix). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
rgao-coreweave
approved these changes
Jun 11, 2026
rgao-coreweave
left a comment
Contributor
There was a problem hiding this comment.
Interesting find, thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split out of #86 per review (@rgao-coreweave noted the hook-handler change is a separate concern from the daemon-side cross-session fix).
Problem
The Weave daemon is started lazily by whichever Claude Code session's hook fires first. If that terminal closes mid-run (engineer closes the tab), the resulting SIGHUP kills the daemon and wipes its in-memory cross-session team map — breaking agent-teams nesting for every still-running specialist.
Fix
nohupmakes the daemon ignore SIGHUP;disowndetaches it from the shell's job table. macOS has nosetsid, so nohup+disown is the portable detach. The daemon still self-reaps via its inactivity timeout, so it won't linger.Observed live: repeated daemon restarts during a multi-session
/triage(a closing coordinator terminal was one cause) orphaned specialist spans. Pairs with the inactivity-guard in #86 — together they keep the daemon alive across an agent-teams run's quiet windows and terminal churn.🤖 Generated with Claude Code