Repository navigation
Conversation
Auto-settlement reused the completion-alert rule, which ignores pending background commands. A Claude background Bash the agent is waiting on wakes the agent when it exits, so the thread settled while it was still working. Any live pending background task now holds auto-settle. Alerts and sidebar status keep their rule.
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a narrowly scoped, well-tested bug fix that prevents auto-settlement while any background task can still wake the agent, without changing configured default values or unrelated runtime behavior. The documentation accurately describes the intentional delay for long-lived commands. You can add or adjust custom eligibility rules. Learn more. |
|
Note Written by Hi! We are cleaning up open PRs, and this one does not say which model or harness was used to create it. If this change is really important, we recommend rebuilding the PR with a newer model and noting the model and harness in the PR description. |
|
Reopened as #18062 with the model and harness noted: Claude Opus 5.5 via t3code. |
|
Note Written by Reopening, this was closed by mistake. Sorry for the noise! |
Fixes #17625
Related: #15099 (the completion alert for the same case, which this PR leaves unchanged) and #15413.
Problem
A thread auto-settles while the agent is still waiting on a live background command. Claude records every background Bash as a pending task of kind
command, and the CLI wakes the agent when that command exits. Auto-settlement reused the completion-alert rule,backgroundWorkHoldsCompletion, which treats acommandas "the agent is done". When the merge rule or the inactivity rule came due, the thread settled while the composer still showed the command running, and the agent later woke up in a settled thread.Change
isAutoSettlementCandidatenow rejects a thread with any live pending background task, whatever its kind. That one check covers both the settlement sweep andresolveAutoSettlementAt, so the merge rule and the inactivity rule both wait. Completion alerts and sidebar status keep their current rule, so a dev server left running still lets the "done" notification fire.The user guide's auto-settle section now says a background command holds the thread until it exits.
Trade-off: a thread with a dev server or another long-lived command left running stays unsettled until the command exits or the user settles the thread by hand. Auto-settle is silent and hides the thread, so holding it a little too long is the cheaper mistake.
Scope and approval
This fixes the bug reported in #17625, using the fix that issue suggests. It changes only the auto-settlement gate on the server, plus its tests and one sentence of user docs.
Verification
Replaced the test that expected a live
commandto allow auto-settle with one that expects it to hold the thread. Added a test where a thread with a livecommanddoes not settle under either the merged-PR rule or the inactivity rule, and the same thread with no pending tasks settles under both. Both new tests fail with the old check and pass with the fix. The existing settlement service and settlement projection tests still pass, and the server package typechecks. I did not reproduce the bug end to end in a running app.Written by Claude Opus 5.5 via t3code. This PR was opened by Grok Bot.