Skip to content

fix(server): a Cursor command you stop shows as interrupted - #13806

Merged
juliusmarminge merged 1 commit into
t3code/codex-turn-mappingfrom
fix/v2-cursor-stopped-tool-status
Sep 26, 2026
Merged

juliusmarminge merged 1 commit into
t3code/codex-turn-mappingfrom
fix/v2-cursor-stopped-tool-status

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

When you stop a Cursor turn while a command is running, the command is saved as completed, as if it had finished. The run and provider turn are correctly interrupted.

Evidence

Seen live on the V2 head with gpt-5.4-nano. The prompt ran for i in $(seq 1 60); do echo tick $i; sleep 1; done and was stopped about 17s into the command. The provider log has a tool-call-started for the shell call, then run.cancel, then run.completed with status: "cancelled". It never has a tool-call-completed. The projection then held:

provider_turn  status=interrupted
command_execution  status=completed  input="for i in $(seq 1 60); ..."  (no output, no exit code)

Pi and Codex report a stopped command as interrupted, and Claude reports it as failed.

Fix

finalizeTurn closes any tool that never got a tool-call-completed. It used to close them as completed. Now, when the turn ends interrupted, failed, or cancelled, those tools take that status. Tools on a turn that completes normally are unchanged.

Web keeps stopped rows visible once #13790 lands. Without that PR, web hides them, the same as for Codex.

Verification

  • turn_interrupt_mid_tool/cursor_output.ts now asserts commandItem.status === "interrupted". The recorded transcript already stops mid-command without a tool-call-completed. vp test run src/orchestration-v2/testkit/OrchestratorReplayFixtures.integration.test.ts -t cursor:
    • Before the fix: expected 'completed' to equal 'interrupted' (1 failed, 9 passed).
    • After: 10 passed.
  • vp test run src/orchestration-v2/Adapters/CursorAdapterV2.test.ts: 11 passed.
  • vp exec tsc --noEmit -p . in apps/server: no error TS or warning TS. vp run knip:check: clean.
  • vp lint on the two touched files reports one warning. It is the unused layer at the end of CursorAdapterV2.ts, which is already on the base and is not touched here.
  • Not run: the full server suite, and a live Cursor stop after the fix.

Model: Claude Opus 5.5 (Claude Code)

🤖 Generated with Claude Code


Devin Review

When a turn is stopped mid-tool, Cursor never sends tool-call-completed for
the running command. finalizeTurn closed those tools as "completed", so the
cut-short command looked like it finished. Unfinished tools now take the
turn's terminal status (interrupted, failed, or cancelled), as Pi and Codex
already report them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire — 4.9 KiB — 6.8 KiB ✅
Codex Thread snapshot wire — 3.7 KiB — 4.9 KiB ✅
Codex Live turn WebSocket wire — 1.1 KiB — 2.0 KiB ✅
Codex Live turn WebSocket decoded — 20.4 KiB — 29.3 KiB ✅
Codex Live turn messages — 1 — 8 ✅
Claude Total thread wire — 4.9 KiB — 6.8 KiB ✅
Claude Thread snapshot wire — 3.7 KiB — 4.9 KiB ✅
Claude Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Claude Live turn WebSocket decoded — 20.8 KiB — 29.3 KiB ✅
Claude Live turn messages — 2 — 8 ✅

Baseline: unavailable · PR result: ebb0000 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 106.1 KiB
  • Claude decoded thread snapshot: 106.4 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@macroscopeapp

macroscopeapp Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at ebb0000

Macroscope's review found this PR approvable — This is a small, self-contained server bug fix that correctly marks unfinished Cursor commands with the enclosing turn’s terminal status. Existing completed-tool behavior is preserved, and the interrupted-mid-tool regression is explicitly tested.

You can add or adjust custom eligibility rules. Learn more.

@juliusmarminge
juliusmarminge merged commit c38c60f into t3code/codex-turn-mapping Sep 26, 2026
25 checks passed
@juliusmarminge
juliusmarminge deleted the fix/v2-cursor-stopped-tool-status branch September 26, 2026 18:28
juliusmarminge added a commit that referenced this pull request Sep 26, 2026
Brings in the V2 bug-hunt fixes merged while this PR was refreshed
(#13787, #13789, #13790, #13797, #13805, #13806). No conflicts.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant