Repository navigation
fix(coding-agent): preserve task background services - #242
Merged
Merged
Conversation
Keep successful background groups alive only after publishing environment ownership. Preserve session cleanup by default and verify identities before later group termination.
- Keep process identities stable across supervisor timezones and retain ownership when publication fails. - Verify cancellation ordering and preserve default shell timeout behavior.
- Expose environment ownership through CLI and SDK sessions, including child and replacement sessions. - Keep successful services alive across print-mode shutdown and later failures while terminating active work. - Cover text and JSON CLI execution, signals, subagent deadlines, and repeated disposal with real TCP-service regressions.
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.
Summary
An explicit environment lifetime now transfers those services at shell completion so they remain reachable after CLI or subagent exit, including later failures and interruptions.
Session-owned cleanup remains the default.
Reasoning
Ownership must transfer before the next provider response, not only after successful CLI completion.
Diffex atomically publishes process identities and ownership records before releasing both session and global cleanup registrations, allowing an environment supervisor to recover after forced CLI death.
Active, failed, and timed-out commands remain session-owned.
Changes
Testing
npm run checkpassed../test.shpassed, including 2,942 coding-agent tests.