Repository navigation
fix(server): settling a thread no longer closes its agent or drops pending work - #3
Merged
Merged
Conversation
…nding work Settling detached the thread's provider sessions, cancelled queued notification and delegated-completion runs, cancelled pending questions, ended pull request watches, and closed idle terminals. Auto-settle could fire at the moment a background task finished, when Claude Code had just started a turn to deliver the task notification but T3 had no run for it yet; the detach closed the query, killed that turn, and the thread then stalled silently. Settling is now only a sidebar status change: - manual and automatic settle no longer detach provider sessions, cancel queued automatic runs or pending runtime requests, or end PR watches; archive keeps its existing cleanup - settle runs the project's settle scripts and stops terminals marked stopOnSettle, but no longer closes other idle terminals - usage-limit auto-resume, PR-watch wakes and subagent limit recovery proceed on settled threads - starting a queued run on a settled thread unsettles it, so a running thread never sits under Settled (dispatched messages already did) - auto-settle is off by default (on merge: false, after days: null), and a closed pull request settles only when the merge setting is on; the setting is relabelled "merges or closes" on web and mobile Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and recovery Settling became display-only, but several places still treated a settled thread as finished work: - storage cleanup no longer holds a usage-limited thread's worktree when the thread was settled, so it could delete a checkout a pending auto-resume needs; settled threads are now held like any other - storage cleanup counted every live shell in a worktree as blocking, so now that settling keeps idle shells open a settled worktree could never be cleaned; only terminals running a command (or still starting) block, and idle-prompt shells there are closed just before the worktree is removed (closeIdle now reports whether everything closed) - the restart continuation skipped settled threads; it now continues them - the web limit banner and mobile limit card hid the resume-at-reset action on settled threads; they now offer it - settle scripts and stopOnSettle terminals could run while an agent was starting a turn as the thread settled (a background task's result); they now run only when the thread is still settled and has no active, queued or background work User docs explain that settle actions run only on an idle settled thread, that idle shells are closed on worktree removal, that restarts resume settled threads, and that auto-settle is now off by default even for settings that were never changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Settling a thread (by hand or automatically) detached the agent's provider session without checking for a running turn, cancelled queued notification and delegated-completion runs and pending questions, and ended PR watches. In production, auto-settle fired the instant a background task finished, while Claude Code was starting the turn that delivers the task's notification; settle closed the session mid-turn and the thread stalled silently for hours.
Settling is now a sidebar status:
stopOnSettleterminals still run, but only when the thread is still settled and idle (rechecked before running). Other idle shells are no longer closed on settle; they are closed when storage cleanup removes the worktree.sidebarAutoSettleOnMergefalse,sidebarAutoSettleAfterDaysnull), also for users who never changed the setting. A closed PR now obeys the same setting as merge ("Auto-settle when a pull request merges or closes", web and mobile).vp test run src/orchestration-v2/runtimeLayer.test.tsvp test runThreadSettlementService, control-reads, UsageLimitRecoveryWorker, terminal/Manager, GuestShare, ThreadManagementServicevp test runThreadSettlementService, RestartContinuation, ProjectSetupScriptRunner, terminal/Managervp test run src/storageCleanup.test.tsUsageLimitRecoveryBanner.test.tsx; web settings search/useSettings; mobile settingsvp run check:changednode:sqlitelacksStatementSync.stat, fails without this change) and load-sensitive ssh "concurrent launches"Claude Opus 5.5 via Claude Code (T3 Code).