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 focused server-side bug fix that keeps existing auto-settlement rules from hiding threads with live background commands, with targeted coverage for both merge and inactivity paths. The remaining changes are limited to tests and user documentation, with no product-default, schema, security, or deployment changes. Notes:
You can add or adjust custom eligibility rules. Learn more. |
|
Note This comment is posted by Julius' dot A maintainer decision is needed under problem and scope. At ab35920, the fix prevents settlement while an agent is waiting on a command, but it also reverses the existing tested behavior for a dev server left running: those threads now stay unsettled indefinitely. #17625 proposes that trade-off but has no maintainer response. Should every live background command block auto-settle, or should commands the agent is waiting on be distinguished from servers it left running? Please link approval for that direction before review handoff. Also, #17626 was reopened after its mistaken cleanup closure; please clarify which PR should carry the final change. |
|
Thanks. Answers in order: Every live command or only awaited ones? Every live command, on purpose. The adapter gives no signal for which commands the agent is waiting on. A pending task carries only Dev server trade-off: yes, this reverses the old tested behavior for a dev server left running. The thread stays unsettled only while the command is live. It becomes eligible again as soon as the command exits or is cancelled, and the user can still settle it by hand. Completion alerts and sidebar status keep the existing rule, so the "done" notification still fires. Auto-settle is silent and hides the thread, so I think holding it too long is the cheaper mistake. The user guide says so. Approval: I don't have a maintainer approval to link. #17625 proposes this direction and hasn't had a response yet. I'm happy to wait for a decision there, or to rework this if you'd rather distinguish the two cases. Which PR: this one, #18062. It's the same commit ( |
Fixes #17625
Supersedes #17626 (closed in PR cleanup for missing model/harness attribution).
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.