Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Stop can't end background work after a run fails before its provider starts ("Run … is not interruptible") #15472

Closedvitalyiegorov(GitHub profile, opens in a new tab) opened this issue 1 comment

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

  1. Let a turn finish while it leaves background work running (here a gh pr checks --watch shell). The composer shows Running: … Stop.
  2. Send a message that fails before the provider starts. Here it was the refusal from #15471.
  3. Press Stop on the background work banner, or in the composer.

Expected behavior

Stop ends the background work, as it does when the newest run completed normally.

Actual behavior

A toast says Run run:thread:<id>:ordinal:18 is not interruptible. The work keeps running and the banner stays. Each new message adds another failed run, so the thread is stuck until the work ends on its own.

Cause

With no active run, interruptThreadTurn (packages/client-runtime/src/operations/commands.ts) sends run.interrupt for the newest run, because the thread shows pending background work. That's the right target: the server only reaches background work through the newest run (hasBackgroundWork in dispatchRunInterrupt, apps/server/src/orchestration-v2/Orchestrator.ts).

The handler then looks for a provider turn of that run's attempt. A run that failed before its provider started has none, so it rejects the run as not interruptible. The work belongs to an earlier turn of the same provider thread.

Suggested fix

In dispatchRunInterrupt, when the run has background work but no provider turn of its own, use the provider thread's latest turn. Its session owns the work, and settled-turn interrupts already work this way: Claude closes the CLI process for the native thread, and the settle follow-up ends what's left. It's server-only; the client already sends the right run. I can open the PR.

Impact

Major degradation or frequent failure

Version or commit

t3@0.0.46-nightly.20261004.2644 (main 8fb068c498)

Environment

Linux host (systemd service), macOS desktop client.

Screenshots, recordings, or supporting files

Stop on the running shell is rejected for the failed run 18:

Run …:ordinal:18 is not interruptible toast above the Running banner

Workaround

Wait for the background work to end on its own, or restart the server.

  • #15471: the failure that left the newest run without a provider turn here. Any pre-start failure does the same.
  • #15013 tracks V2 interrupt hardening. This case is not on its list.
  1. PR opened: #15474. When a stopped run has background work but no provider turn of its own, dispatchRunInterrupt now falls back to the provider thread's latest turn. The existing Stop integration test now stops a run that failed before its provider started; it fails on main with this exact error.

  2. maria-rcks closed this

Sign in to join this conversation.