Skip to content

fix(server): Claude plan mode never shows Implement - #7263

Open
imMxts wants to merge 1 commit into
pingdotgg:mainfrom
imMxts:prep/2519
Open

fix(server): Claude plan mode never shows Implement#7263
imMxts wants to merge 1 commit into
pingdotgg:mainfrom
imMxts:prep/2519

Conversation

@imMxts

@imMxts imMxts commented Aug 16, 2026

Copy link
Copy Markdown

Fixes #2519

What Changed

ClaudeAdapter.sendTurn sets inPlanMode on the existing interactionMode plan/default branches. Absent interactionMode leaves the previous value unchanged.

completeTurn then calls the existing emitProposedPlanCompleted helper when the SDK result is present, status is completed, it is not a refusal, inPlanMode is true, the turn is not synthetic, capturedProposedPlanKeys is empty, and no user input is pending. Plan text comes from result.result, then assistant fallbackText. Raw source stays claude.sdk.message; the method is claude/result/plan-text.

Why

Claude Opus in plan mode often writes the plan as markdown and skips ExitPlanMode. proposedPlans stays empty, so the Implement control never arms. Users type "go". Confirmed on the issue through 2026-08-05.

Implement already renders once turn.proposed.completed lands (ChatView.tsx:2301, hasActionableProposedPlan at session-logic.ts:678). Claude only filled that event from ExitPlanMode (canUseTool at ClaudeAdapter.ts:3997, assistant snapshot at :2978). completeTurn already owns successful turn end. One extra call through the existing helper, gated by capturedProposedPlanKeys.size (ExitPlanMode keys are tool:${id}, so the helper's markdown key would not collide), is the smallest way to arm the same control. Codex already emits this from a native plan item (CodexAdapter.ts:1117); Cursor from cursor/create_plan (CursorAdapter.ts:626).

Synthetic auto-close, interrupt, failed turns, refusals, pending AskUserQuestion, and later background turns stay out.

Test

  • prefers result text over assistant text when ExitPlanMode is skipped failed on upstream/main before the fix (AssertionError: expected undefined to equal 'turn.proposed.completed'). It passes once completeTurn emits through the existing helper.
  • Skip cases: not plan mode, empty result and assistant text, stop_reason: "refusal", ExitPlanMode already captured, pending user input, later synthetic turn.
  • vp test run apps/server/src/provider/Layers/ClaudeAdapter.test.ts — 77 passed.
  • Targeted lint on the two planned files: 0 errors (pre-existing no-useless-spread warning at ClaudeAdapter.ts:3708, untouched).
  • vp run --filter t3 typecheck: ok (pre-existing suggestions in unrelated files).
  • Did not run web, mobile, desktop, or other adapter suites.

UI Changes

No UI change.

Deliberately not included

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Implemented with grok-4.6 in T3 Code.

Note

Fix Claude plan mode to emit proposed plan when ExitPlanMode tool-use is skipped

  • In plan mode turns that complete without an ExitPlanMode tool-use, the adapter now emits a turn.proposed.completed event using result text (falling back to assistant text) via a new planMarkdownFromSkippedExit helper in ClaudeAdapter.ts.
  • A new inPlanMode flag on ClaudeSessionContext tracks whether the current turn is in plan mode, set by sendTurn based on interactionMode.
  • Emission is skipped for refusals, synthetic turns, turns where a plan was already captured via ExitPlanMode, and turns with pending user input.

Macroscope summarized 92ec3da.


Note

Low Risk
Scoped to Claude adapter turn completion and plan-mode gating; reuses existing emit helper with dedupe guards and no UI or API contract changes.

Overview
Fixes plan mode where Implement never appeared because Claude often finished with markdown in the SDK result instead of calling ExitPlanMode.

ClaudeAdapter now tracks inPlanMode on the session (set from sendTurn when interactionMode is plan or default). On a successful turn completion, if the turn is in plan mode and no plan was already captured from ExitPlanMode, it emits turn.proposed.completed through the existing helper, using planMarkdownFromSkippedExit (SDK result text first, then assistant text fallback) with raw method claude/result/plan-text.

Emission is skipped for non–plan-mode turns, refusals, empty text, duplicate capture after ExitPlanMode, pending AskUserQuestion, and synthetic follow-up turns. Tests cover the happy path and these guardrails.

Reviewed by Cursor Bugbot for commit 92ec3da. Bugbot is set up for automated code reviews on this repo. Configure here.

Plan-mode turns that skip ExitPlanMode now emit turn.proposed.completed from the success result (assistant text as fallback) so Implement can arm.

Implemented with grok-4.6 in T3 Code.
@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

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: e1644fd5-356a-4e7e-93af-9570cdfbf866

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:M 30-99 changed lines (additions + deletions). labels Aug 16, 2026
@imMxts
imMxts marked this pull request as ready for review August 16, 2026 21:34
@macroscopeapp

macroscopeapp Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR adds new runtime behavior to Claude's plan mode, enabling 'Implement' to appear when ExitPlanMode is skipped. While the fix is well-tested, it modifies core agent adapter logic and is the author's first contribution to this file.

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

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

Labels

size:M 30-99 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.

[Bug]: Implement Plan Button Does not Appear after plan has be generated successfully

1 participant