Skip to content

fix(daemon): hold daemon open while a turn or tool is in flight#93

Draft
rgao-coreweave wants to merge 1 commit into
fix/daemon-session-reconstructionfrom
fix/daemon-idle-during-inflight
Draft

fix(daemon): hold daemon open while a turn or tool is in flight#93
rgao-coreweave wants to merge 1 commit into
fix/daemon-session-reconstructionfrom
fix/daemon-idle-during-inflight

Conversation

@rgao-coreweave

@rgao-coreweave rgao-coreweave commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

checkInactivity only held the daemon open for in-flight cross-session team work. A plain long-running tool or turn (longer than the idle timeout, with no other session active) tripped the timeout mid-flight: the daemon exited, dropped the still-open spans, and the resumed work landed on a fresh daemon.

Extend the hold to any session with an open turn span, a pending tool call, or a tracked subagent, under the same ceiling.

Test plan

  • node --import tsx --test tests/daemon-idle-inflight.test.ts

checkInactivity only kept the daemon alive for in-flight cross-session team
work. A plain long-running tool or turn (longer than the inactivity timeout,
with no other session active) tripped the timeout mid-flight: the daemon
exited, dropped the still-open turn/tool spans, and the resumed work landed on
a fresh daemon. Observed locally as reboots within 3s of an inactivity
shutdown.

Extend the hold to any session with an open turn span, a pending tool call, or
a tracked subagent, under the same TEAM_INFLIGHT_MAX_MS ceiling.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

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