Skip to content

bug(cli): stream-json interrupt aborts reusable session controls #8495

Description

@ryan-mt

What happened?

In non-interactive stream-json mode, interrupting the active turn aborts session-lifetime control infrastructure as well as the turn. The control dispatcher and pending control requests use the same signal as the current model turn, so interrupt() can make the session unusable for later prompts or leave request ownership ambiguous.

Deterministic reproduction:

  1. Start a reusable non-interactive stream-json session.
  2. Begin a turn and issue a turn-owned control request.
  3. Interrupt the active turn.
  4. Submit another prompt on the same session.
  5. Observe that session-lifetime dispatch has also been aborted, so later control traffic cannot proceed reliably.

What did you expect to happen?

Interrupt should cancel only the active turn and its pending control requests. The session and lifetime dispatcher should remain usable for a later prompt, and full session shutdown should still cancel both lifetime and turn-owned work.

Client information

Client Information
Qwen Code: 0.21.4
Platform: Windows 11
Node.js: v24.16.0
npm: 11.13.0

Login information

Not login-provider specific; reproduced in deterministic CLI session and control-dispatcher tests.

Anything else we need to know?

The lifecycle needs distinct session-lifetime and current-turn abort signals. Pending requests must bind to the signal for the turn that created them rather than whichever turn happens to be current later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    category/cliCommand line interface and interactionpriority/P2Medium - Moderately impactful, noticeable problemscope/non-interactiveNon-interactive modescope/session-managementSession state and persistencetype/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions