Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: A run stopped by an agent says "Run interrupted by user" #16110

Closedakbarakma(GitHub profile, opens in a new tab) opened this issue 2 comments

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. In thread A, have an agent stop a running turn in thread B through the T3 MCP tools, for example t3_thread_interrupt (or task_cancel on a delegated task), with a reason.
  2. Open thread B and look at the end of the stopped turn.

Expected behavior

The divider says an agent stopped the run, the way agent-sent messages are labelled "Sent by another agent" today. Something like "Run interrupted by an agent", linking to the thread that sent the stop when there is one.

A run that ends interrupted with no stop request at all should not credit anyone.

Actual behavior

The divider reads "Run interrupted · Run interrupted by user", although no user pressed Stop.

The server does record the agent's request. In my thread the run_interrupt_request item holds the agent's reason ("Orchestrator taking over verification; revert already built, tested and installed."). But:

  • The result text is hardcoded: makeInterruptResultTurnItem in apps/server/src/orchestration-v2/RunExecutionService.ts always writes "Run interrupted by user" for any run that ends interrupted.
  • The run.interrupt command carries only an optional reason, with no field for who sent it. Nothing downstream can tell a Stop click from an MCP call.
  • The web timeline hides the request row (MessagesTimeline.logic.ts), so the reason never shows either.

Some adapters can also end a turn as interrupted with no request at all. For example, the OpenCode 2 adapter marks a turn interrupted when it reconnects and can't tell how the turn ended (OpenCode2AdapterV2.ts). Those runs also say "by user".

Impact

Minor bug or occasional failure

Version or commit

T3 Code (Nightly) 0.0.46-nightly.20261005.2676; also present on main @ e22c88043

Environment

macOS 27 (Darwin 27.0.0), Apple silicon, desktop app; Codex provider in the stopped delegated thread

Logs or stack traces

# statev2.sqlite (read-only), the stopped delegated thread
run_interrupt_request | Orchestrator taking over verification; revert already built, tested and installed.
run_interrupt_result  | Run interrupted by user

# all interrupted runs in my local database
13 interrupted runs, 13 with a matching run_interrupt_request
11 requests: "Interrupt requested" (Stop button, no reason)
 2 requests: agent reasons sent through MCP
13 results:  "Run interrupted by user"

Screenshots, recordings, or supporting files

run-interrupted-by-user.png

Workaround

None in the UI.

I have a fix in progress and will open a PR shortly. Direction: run.interrupt gets the optional createdBy and senderThreadId fields that message.dispatch already uses, the two MCP interrupt paths set them, and the result text comes from the request: "by user", "by an agent", or no attribution when nothing requested the stop.

  1. akbarakma(GitHub profile, opens in a new tab) added labelsneeds-triage

  2. Note

    Grok responding on behalf of Julius.

    Triage

    Thanks for the precise write-up, @akbarakma! Your trace matches main at e22c88043, and this isn't a duplicate.

    What I found

    • makeInterruptResultTurnItem in apps/server/src/orchestration-v2/RunExecutionService.ts sets message to "Run interrupted by user" without reading the request. It's written for every run whose terminal status is interrupted, including turns nobody asked to stop. The superseded-attempt copy (after a hard Stop leaves an unpaired request) is hardcoded the same way.
    • The web divider (V2LifecycleRow) shows "Run interrupted" with item.message as the detail; mobile does the same in apps/mobile/src/lib/threadActivity.ts.
    • dispatchRunInterrupt does keep the reason (command.reason ?? "Interrupt requested") on the run_interrupt_request item, but MessagesTimeline.logic.ts intentionally hides that row, so the reason never appears.
    • run.interrupt carries runId, an optional reason, and an optional holdQueue. The Stop button sends holdQueue: true with no reason (packages/client-runtime/src/operations/commands.ts). t3_thread_interrupt and task_cancel pass reason and know the caller thread but don't record an actor or sender thread. message.dispatch already has createdBy, creationSource, and optional senderThreadId, and web and mobile already render senderThreadId as a "Sent by another agent" link.
    • A stop before the provider turn starts uses "Run interrupted before provider start", which doesn't say "by user" but also has no actor.
    • In OpenCode2AdapterV2.ts, reconcile can finish a turn as interrupted after a dropped stream with no run.interrupt at all, and finalization still writes "by user".

    Likely fix area

    One option, close to what you outlined, is adding the same optional actor and sender thread that message.dispatch uses to run.interrupt, setting them from both MCP interrupt paths, and deriving the result text from the request: the user, an agent (linking the sender thread on web and mobile), or no attribution when nothing requested the stop. The pre-start result could follow the same attribution.

    A maintainer will decide on the fix direction.

  3. juliusmarminge removed labelsneeds-triage

  4. juliusmarminge added labelsvia-triage

  5. Note

    🤖 Claude Opus 5.5 responding on behalf of Theo

    Closing: this is covered by #24299, which landed. Reopen if an important part is still missing.

Sign in to join this conversation.