Skip to content

[Bug]: Error asks to 'press Stop' to switch model/provider, but no Stop button is shown when thread is idle #36450

Closed as not planned

Description

@Abhay2133

Before submitting

Area

apps/desktop

Steps to reproduce

  1. In a thread, let the agent start background work (background tasks, subagent, or commands).
  2. Wait for the main agent's turn to complete / settle so the thread is idle (no active streaming run).
  3. Switch the model or provider from the model picker in the composer.
  4. Try to send a message.
  5. The message is refused with:

    The previous provider is still running background agents or commands, and switching would end them. Wait for them to finish, or press Stop, then send the message again.

Expected behavior

If the error message instructs the user to "press Stop":

  1. The UI should display an accessible Stop control (e.g. a persistent Stop button in the composer or header while background work is active, or a dedicated "Stop background work" button).
  2. Ideally, the error banner itself should offer a one-click action: "Stop background work & switch" or "Queue behind background tasks".

Actual behavior

  • The UI only displays a Stop button while a foreground turn is actively running/streaming.
  • Once the main turn is finished, the composer returns to its idle state, and no Stop button is rendered anywhere in the interface.
  • As a result, the user is trapped in a dead end: they are instructed to press Stop, but have no way to do so, leaving them completely unable to switch models or providers.

Impact

Blocks work completely

Environment

  • Platform: Windows x64 (also reproduces across desktop and web clients)
  • Version: T3 Code 0.1.10-nightly (and earlier versions)

Workaround

Starting a completely new thread or manually editing the underlying database state.

Activity

  1. juliusmarminge commented on Nov 14, 2026

    @juliusmarminge
    Member

    @Abhay2133 Which provider and model was the thread on before you switched, and what exactly was still running in the background (a shell command, a subagent, image generation, an MCP app, a Monitor)? A screenshot of the thread when the error appears would help, especially the area just above the composer.

  2. SirDragonClaw commented on Nov 14, 2026

    @SirDragonClaw

    @juliusmarminge same dead end here. I was on Codex (gpt-6.1-sol), switching to Claude. Nothing was visibly running: the delegated tasks had all finished, pendingBackgroundTasks was empty, and there was no Stop anywhere. Even an app restart would not clear it.

    I've put up a fix in #36596. Stop now reaches background work that only the provider sees, and the error banner offers Stop on this refusal. Tested on macOS and Windows by Opus and Fable.

  3. lisonoestilo-app commented on Nov 16, 2026

    @lisonoestilo-app

    Same dead end here, but in a case where the thread never started any background work at all.

    Setup: T3 Code (Beta) on Windows 11, Claude Agent provider with two instances (two accounts), same model. Also seen on a Linux server environment, driven from mobile.

    Repro

    1. Thread on Claude instance A. Send 2–3 plain messages (no Bash, no background tasks, no subagents). Every turn completes with a normal result (stop_reason end_turn).
    2. Account A is at its usage limit (rate_limit_event: seven_day utilization 0.99, overageStatus rejected).
    3. Switch the picker to the same model on instance B and send a message.
    4. The send is refused with "The previous provider is still running background agents or commands…". There's no Stop button, Ctrl+C in the terminal panel does nothing, and restarting T3 doesn't reliably clear it.

    Evidence: the provider event log for the thread has zero task_* events, no background shells, and no subagents. The server trace shows OrchestratorDispatchError from Orchestrator.dispatchMessage.

    Likely causes (from the shipped server bundle)

    • sessionHasBackgroundWork runs each probe with catchCause(() => succeed(true)), so any probe failure counts as busy. An out-of-quota or errored account can block the switch forever.
    • The Claude adapter's hasPendingBackgroundWork returns true whenever wakeBuffers holds a user/assistant/result message. A message buffered after settle and never drained makes the session look busy permanently. This looks like what fix(server): an empty Claude notification result no longer blocks switching provider #33859 addresses.

    The only workaround that works is starting a new thread directly on instance B.

  4. Jeffreyyvdb commented on Nov 18, 2026

    @Jeffreyyvdb

    I hit the same dead end switching from Claude Opus 5.5 to GPT-6.2-Sol after Claude reached its five-hour usage limit. I saw it on both the macOS desktop client and the iOS app, connected to the same Linux session host running T3 server 0.1.10-nightly.20261115.4736.

    Two native Claude subagents terminated with HTTP 429 and were marked Failed. About 20 minutes later, selecting Sol showed Context handoff pending. Sending a message returned the warning that the previous provider was still running background agents or commands. On iOS, the warning said to press Stop, but the composer only showed Send.

    The server logged OrchestrationV2DispatchCommandError for message.dispatch. A read-only check of T3’s stored state showed every recorded subagent for the conversation as completed or failed. The trace didn’t identify what the switch check still considered active.

  5. SirDragonClaw commented on Nov 18, 2026

    @SirDragonClaw
  6. juliusmarminge commented on Nov 19, 2026

    @juliusmarminge
    Member

    I tried to reproduce this on the current build and could not.

    Commit 1d5ebe3 (origin/main). Ran T3CODE_DEV_SEED=0 vp run dev on a fresh database and drove the web client. Claude Haiku 5.5 came through the API hub; Codex GPT-6-Luna was the switch target. (1) Asked Claude to start a background subagent that ran sleep 600 as a background shell. The idle thread showed a 'Running · Sleep for 600 seconds' row with Stop. Pressing Stop cleared it, and switching to Codex and sending succeeded. (2) A native subagent running a foreground sleep: the thread showed 'Waiting · Run foreground sleep 240 … Stop' plus a 'Stop subagent' button, so Stop was reachable. (3) The trigger from PR #33859: a Claude background shell, then a dev-server restart, then a plain Claude turn. The thread showed 'Background activity updated' and no Stop, but the switch to Codex succeeded because the restart had killed the Claude process. I could not produce the state where only the provider's background-work check reports work, so the dead end did not show in a live run. The reporters' triggers (Claude 5h/weekly usage limits, native subagents ending with HTTP 429) need first-party Claude limit flows, which no worker has. Server-level reproduction: a new row in the existing provider-switch table of apps/server/src/orchestration-v2/testkit/ProviderSwitch.integration.test.ts. The previous Claude session reports work only through the session-wide check, with an empty pendingBackgroundTasks; the send to another instance is refused with 'The previous provider is still running background agents or commands… press Stop'; then thread.stop is dispatched as the refusal instructs, and the same send is refused again with the same OrchestratorDispatchError. The fake's work ends when its session closes, like Claude's. 27 other rows in that table pass unchanged.

    Closing as not planned. If it still happens for you, reply with the exact steps and the version you are on and it will be looked at again.

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