Skip to content

fix(cursor): implement the latest refined plan - #4942

Closed
redwon wants to merge 3 commits into
pingdotgg:mainfrom
redwon:fix/cursor-plan-refinements
Closed

redwon wants to merge 3 commits into
pingdotgg:mainfrom
redwon:fix/cursor-plan-refinements

Conversation

@redwon

@redwon redwon commented Jul 30, 2026 •

Copy link
Copy Markdown

What Changed

  • persist Cursor plan markdown behind the ACP planUri
  • refresh changed plan markdown before a turn completes
  • cover the initial-plan and refinement flow with focused adapter tests

Why

Cursor plan refinements edit the plan file returned by cursor/create_plan. T3 previously returned a non-contract response without a backing file, so the Implement action could paste the initial plan after the user refined it. Returning the documented outcome and projecting the backing file keeps implementation aligned with the latest accepted plan.

Verification

  • pnpm exec vp test run apps/server/src/provider/acp/CursorAcpExtension.test.ts apps/server/src/provider/Layers/CursorAdapter.test.ts
  • pnpm exec vp run --filter t3 typecheck
  • targeted lint for all edited files

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • UI screenshots are not applicable; this is a provider adapter fix
  • Interaction video is not applicable

Generated with GPT-5.6 Sol in Cursor.

Made with Cursor

Note

Implement three-step refined plan flow in CursorAdapter for ACP create-plan

  • Adds a CursorCreatePlanResponse schema in CursorAcpExtension.ts with a discriminated outcome union (accepted, rejected, cancelled) including an optional planUri.
  • The cursor/create_plan handler in CursorAdapter.ts now persists plan markdown to a deterministic file path under stateDir/plans/cursor/{instanceId}/{threadId}.md and returns a planUri file URL to the caller.
  • Before each turn.completed event, syncProposedPlanFromFile reads the backing file and emits a turn.proposed.completed event, enabling refined plan markdown written during the turn to be surfaced before the turn closes.
  • The mock agent in acp-mock-agent.ts implements the full three-prompt flow when T3_ACP_EMIT_CREATE_PLAN=1: propose initial plan (capture planUri), write refined markdown to the file, then re-propose the refined plan.
  • Deduplication in emitProposedPlanCompleted prevents repeated turn.proposed.completed events for identical plan content within a session unless forced.

Macroscope summarized d646f5d.

Persist Cursor plans behind the ACP plan URI so refinements are projected before implementation starts.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 67b04ce2-f024-478e-a35c-7854d7fd72ce

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Jul 30, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit dc3766c. Configure here.

@macroscopeapp

macroscopeapp Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces new plan file persistence and syncing capabilities with file I/O, state tracking, and protocol response changes. Despite the 'fix' label, these are significant runtime behavior changes that warrant human review.

You can customize Macroscope's approvability policy. Learn more.

Only deduplicate passive file refreshes so a newly proposed plan remains actionable even when its markdown is unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
Prevent multiple configured Cursor instances from sharing a thread's backing plan file.

Co-authored-by: Cursor <cursoragent@cursor.com>
@juliusmarminge

Copy link
Copy Markdown
Member

Closing in favor of #2829 (orchestration V2).

#2829 deletes the V1 orchestration layer this PR builds on — apps/server/src/orchestration/**, provider/Layers/*Adapter.ts and provider/Services/** are removed and replaced by apps/server/src/orchestration-v2/**, with the IPC surface renamed to ORCHESTRATION_V2_WS_METHODS. The files this PR touches either no longer exist or are rewritten, so it can't be rebased — it would need reimplementing against the V2 adapters.

This is not a judgement on the change itself. Several of these are real gaps we still want fixed; the base just moved out from under them.

Once #2829 merges, please rebase onto main, port the change to the V2 equivalent, and reopen (or open a fresh PR). Ping me and I'll prioritise the review.

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

Labels

size:L 100-499 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.

2 participants