Skip to content

An accepted Stop can still finalize the run as completed #41617

Done

Description

@satyalyadav

What happened

I pressed Stop on a running V2 thread. T3 recorded "Stopped by user", then persisted the run as completed 128 ms later. The run's last action was a failed patch, so completed read as success even though the work was not done. The empty checkpoint is unrelated: the edits were outside the thread's scratch workspace.

Diagnosis

A successful provider terminal is persisted as waiting (RunExecutionService.ts:821); checkpoint capture later flips waiting to completed (CheckpointCaptureService.ts:320). Capture decides whether the run was stopped only from its persisted status (CheckpointCaptureService.ts:77): it never checks for a run_interrupt_request with no run_interrupt_result. Stop records that request and asks the provider to interrupt, but does not change the run's status. So a Stop that lands around finalization is ignored by the step that stamps completed.

For this run (UTC): dispatch starts 18:01:05.313, provider finalization 18:01:05.515-18:01:05.617, request item committed 18:01:05.595, capture committed completed 18:01:05.723, adapter interrupt 18:01:06.188. The run has one request and zero results. The event log was already pruned, so I cannot say whether the waiting write committed before or after the request; either way, capture is the step that ignores it. A real provider terminal is guarded only by active attempt + expectedStatus: "running" (RunExecutionService.ts:1294); the interrupt-request gate there applies only to the workspace-handoff retry.

Steps to reproduce

  1. Put a run in waiting with an active attempt and checkpoint scope.
  2. Add a run_interrupt_request and no run_interrupt_result.
  3. Run checkpoint.capture. It writes run.updated status=completed and leaves the request unpaired.

Live path: a provider turn.terminal with completed that arrives while Stop is being dispatched; delaying interruptTurn in a fake adapter should preserve the window.

Version

0.1.12-nightly.20261121.5051

Environment

WSL2 Linux x64, Node 26.13.1; T3 Code Desktop and local server both 0.1.12-nightly.20261121.5051; provider OpenCode, model asu/glm-5-3-flash.

Evidence

18:01:05.313  Orchestrator.dispatchRunInterrupt starts
18:01:05.515  RunExecutionService.writeFinalRunEvents starts
18:01:05.595  turn-item run_interrupt_request "Stopped by user"
18:01:05.723  checkpoint [] + run.updated status=completed
18:01:06.188  OpenCode2Adapter.interruptTurn

One interrupt request, zero interrupt results; completedAt equals checkpoint time.

Related issues

#15124 covers the waiting/Stop window and treats Stop staying available as by design. #30989 is the inverse: Force stop leaves a run running. Neither covers an accepted Stop finalizing as completed.

Fix applied or workaround

None. An unpaired run_interrupt_request on a completed run is the signal that Stop was lost; do not treat completed as success.

Filed by

T3 Code triage agent, DeepSeek V4.1 Flash (OpenCode); reviewed by Claude Opus 5.5 (Kiro).

Activity

  1. added
    via-triage
    on Nov 23, 2026
  2. four1er commented on Nov 23, 2026

    @four1er

    Reproduced the diagnosis on current main — CheckpointCaptureService flips a waiting run to completed without checking for an unpaired run_interrupt_request. Working on a fix now and will open a PR shortly.

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

    via-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions