You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Claude background-only Stop treats an unconfirmed query close as successful #30986
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
Code-derived reproduction, not executed:
Complete a Claude foreground turn while retaining a live query and running background work or a native subagent.
Configure the query fixture’s close operation to return immediately without ending its message stream or confirming closure.
Request thread Stop.
Allow the query-close confirmation wait to expire after 10 seconds.
Expected behavior
If the query does not confirm closure, Stop should remain unresolved, mark the agent unresponsive, and offer Force stop.
Actual behavior
The background-only Stop path clears the live query reference after the close-confirmation timeout. It performs query-exit cleanup, terminalizes subagents, resolves the query’s closed deferred, clears background state, and returns successfully.
Unlike the foreground Stop path, it does not return ProviderAdapterInterruptTimeoutError. The unresponsive path therefore does not run.
Impact
Minor bug or occasional failure
Background work is represented as stopped without confirmed query closure, and the Stop banner does not offer Force stop. It needs a provider that doesn't confirm the stop (or the timing described above), so it is occasional rather than constant.
ClaudeAdapterV2.ts:11279–11307: after the 10-second confirmation timeout, the helper clears queryContext, finalizes query-owned work, and succeeds existing.closed.
Found by reading the code while porting the Stop / Force stop changes (6b1245c, 5f2c27e) into a fork. Derived from the code at 9e85538; not reproduced at runtime.
Activity