Skip to content

fix(cursor): keep failed plans from becoming actionable - #23172

Open
only21mil wants to merge 4 commits into
pingdotgg:mainfrom
only21mil:r13/a015-keep-failed-plans-from-becoming-actionab
Open

only21mil wants to merge 4 commits into
pingdotgg:mainfrom
only21mil:r13/a015-keep-failed-plans-from-becoming-actionab

Conversation

@only21mil

@only21mil only21mil commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem

A Cursor createPlan call can finish with an error while T3 marks its proposed plan active. The plan node and turn item already say failed, but clients can still offer to implement the plan and the server accepts it as a source plan.

Change

Retire a failed proposal with the existing superseded status. Keep its markdown and failed turn item for inspection. A plan starts as a draft, and a successful completion still makes it active.

Add a focused adapter regression for both outcomes. It checks that the start and completion update the same plan, preserve its markdown, and agree with the node and turn-item status.

Scope and approval

This is a small, focused fix for an obvious status contradiction in the Cursor SDK adapter. It uses the existing lifecycle and needs no schema or client changes. No matching issue was found.

Verification

  • vp test run packages/provider-cursor/src/server/adapter.test.ts -t "keeps a completed Cursor plan" --maxWorkers=1: the failed-plan case fails on base because it receives active; the successful control passes. Both cases pass on the candidate.
  • vp test run packages/provider-cursor/src/server/adapter.test.ts --maxWorkers=1: 16/16 pass locally.
  • vp lint packages/provider-cursor/src/server/adapter.ts packages/provider-cursor/src/server/adapter.test.ts and vp fmt --check for the same files pass. The test also passes the newer main test lint rules.
  • Provider-cursor pnpm run typecheck passes locally, with suggestions only.
  • Production web vp build and server vp pack pass for base and candidate. Their web source is identical, so both servers use the same production web bundle.
  • Linux Chromium, isolated app state, legacy Plan mode: send a proposal through the real Cursor SDK 1.0.35 to a local protocol fixture. The fixture also sends a short reply line after the plan. For an error result, base offers Implement and candidate does not. Successful proposals offer Implement on both. Persisted plan statuses are active on base, superseded on candidate failure, and active on candidate success.

Not checked: live Cursor service, a manual sourcePlanRef dispatch, packaged Electron, Windows, iOS and Android. The Orchestrator's active-plan guard was inspected; the fixture supplies provider responses, and screenshots come from the running production app.

Before: the rejected proposal still shows Plan ready and Implement.

Failed plan on base

After: the same rejected proposal keeps its plan text, with no Plan ready banner or Implement button.

Failed plan on candidate

Successful control before and after: both retain Plan ready and Implement.

Successful plan on base

Successful plan on candidate

The new regression fails on base for the rejected proposal; its successful control passes.

Regression fails on base

Both regression cases pass on the candidate.

Regression passes on candidate

Prior PRs: #4942 by Ihor Levchenko (@redwon) addressed refined plan files in the old ACP adapter. Julius Marminge closed it because orchestration V2 replaced those files. This fixes a different SDK status bug and reuses no code. #21448 fixes unfinished generic tool rows in a separate handler.

Generated with Claude Opus 5.5 and GPT-6.1 Sol in T3 Code Nightly

only21mil and others added 2 commits October 20, 2026 20:36
A createPlan call that Cursor finished with an error already marked its
plan node and turn item failed, but the plan artifact still went active.
The thread then showed "Plan Ready" and the implement-plan prompt, and the
server accepted the failed plan as an implementation source. Only a plan
Cursor accepted becomes active now; a failed one stays a draft, so its
markdown and failed row remain visible.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Recover the focused plan lifecycle test and superseded status from lane commits 6b478d3025 and 09fe3f2ea0 verified during the outage. Replace the mixed diagnostics test addition with the dedicated protocol regression.

Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Oct 22, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 5ea0a49

Macroscope's review found this PR approvable — This is a narrowly scoped Cursor adapter fix that prevents failed plan proposals from being presented or accepted as actionable while preserving successful plan behavior. It reuses existing lifecycle statuses and adds focused regression coverage without schema or infrastructure changes.

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

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 5ea0a49 and b91e125.

Files selected for processing: 2
  • packages/provider-cursor/src/server/adapter.test.ts
  • packages/provider-cursor/src/server/adapter.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Walkthrough

Completed Cursor plans now receive superseded status when their operation fails. Parameterized tests verify plan content and the plan, turn item, and node statuses for successful and failed operations.

Changes: Cursor plan status

Layer / File(s) Summary
Set and verify completed plan status
packages/provider-cursor/src/server/adapter.ts, packages/provider-cursor/src/server/adapter.test.ts
Failed completed plan operations now set the plan status to superseded. Successful completed plans remain active, and incomplete plans remain draft. Tests verify plan content and the related item and node statuses for success and failure.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · up to b91e1

Failed Cursor plans are not actionable, while successful plans remain available for implementation. No merge-blocking issue was identified.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: preventing failed Cursor plans from remaining actionable.
Description check Passed The description includes all required sections. It explains the problem, the implementation, scope justification, focused tests, observed results, limitations, and UI verification evidence.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@juliusmarminge juliusmarminge added via-triage:gates-failing Triage fix: a land gate is failing (see PR body) and removed via-triage:gates-failing Triage fix: a land gate is failing (see PR body) labels Oct 22, 2026

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6.1-sol on behalf of Maria

Verified in a real dev environment

partial verification at 5ea0a4983e252e139210e8417318e6db2330df1b, not live acceptance of the cursor fix.

  • installed and ran github/main (32ecd71726) in /home/user/main, then stopped its captured process group before starting the exact pr head in /home/user/pr23172. both used isolated dev state and real git workspaces.
  • drove the web client with repository playwright and /usr/bin/google-chrome. real codex gpt-6.1-sol turns returned SOL_CONTROL_OK on main and the pr.
  • enabled legacy plan mode through settings on the pr, then requested a real sol plan. the two-step proposal rendered, the turn completed, and "plan ready" plus enabled "implement" appeared. no implementation was requested. this checks successful codex planning, not cursor's adapter.
  • ran the existing focused cursor lifecycle regression on blacksmith after installing dependencies: vp test run packages/provider-cursor/src/server/adapter.test.ts -t 'keeps a completed Cursor plan' --maxWorkers=1. both cases passed (14 unrelated cases filtered out). git.cafe reports 34 successful head checks, no failing or pending checks.

main codex control:

main real codex sol response

pr successful codex plan control:

pr real codex plan with plan ready and implement

pr real codex planning interaction

command transcript. captures inspected; uploaded video playback and seeking checked in t3's player.

Not verified

the changed cursor failure behavior remains unverified. the diff handles cursor sdk createPlan, which codex does not exercise. cursor-agent status attempted installation twice; both downloads failed with curl: (56) Recv failure: Connection reset by peer. this vm also has no saved cursor login or CURSOR_API_KEY.

therefore i did not reproduce the original cursor error on main, produce a failed cursor plan on the pr, or exercise its sourcePlanRef rejection through the running server. passing tests and inspection of the existing active-plan guard do not substitute for those checks. no mocks, protocol fixtures, demo data, or synthetic provider events were used.

native mobile, packaged electron, macos/windows, and remote/relay/tunnel modes were not exercised on this linux vm. no source changes or pushes were made. result: unverifiable for the actual fix, with the two codex controls above passing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants