Skip to content

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

Open

Description

@nima20002000

Before submitting

  • 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:

  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 @ 9e85538

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 (6b1245c, 5f2c27e) into a fork. Derived from the code at 9e85538; not reproduced at runtime.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions