t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: Claude background-only Stop treats an unconfirmed query close as successful

Open nima20002000 opened this issue 3 weeks ago • 0 comments

Before submitting

  • [x] I searched existing issues and did not find a duplicate.
  • [x] I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

Code-derived reproduction, not executed:

  1. Complete a Claude foreground turn while retaining a live query and running background work or a native subagent.
  2. Configure the query fixture’s close operation to return immediately without ending its message stream or confirming closure.
  3. Request thread Stop.
  4. 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.

Version or commit

main @ 9e85538535

Environment

Claude adapter with a controlled SDK query fixture. Runtime environment not tested.

Where


Found by reading the code while porting the Stop / Force stop changes (6b1245cced, 5f2c27e706) into a fork. Derived from the code at 9e85538535; not reproduced at runtime.

nima20002000 avatar Nov 04 '26 16:11 nima20002000