Skip to content

Fix plan mode - #1654

Merged
qdaxb merged 3 commits into
mainfrom
fix_plan_mode
Jun 30, 2026
Merged

qdaxb merged 3 commits into
mainfrom
fix_plan_mode

Conversation

@qdaxb

@qdaxb qdaxb commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added a dedicated plan view/card for assistant plans, with copy, download, and full-screen/open options.
    • Improved request-to-user flows with clearer questions, summaries, keyboard shortcuts, and support for implementation-plan confirmations.
  • Bug Fixes

    • Plan content now displays cleanly without raw markup tags.
    • Completed plans are handled consistently across chat, review, and workspace views, including right-panel display and message updates.

@qdaxb
qdaxb merged commit 44256c9 into main Jun 30, 2026
18 of 19 checks passed
@qdaxb
qdaxb deleted the fix_plan_mode branch June 30, 2026 18:29
@coderabbitai

coderabbitai Bot commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ffd22af8-2051-480d-a522-2b305c6f6747

📥 Commits

Reviewing files that changed from the base of the PR and between 29398b7 and c90b181.

📒 Files selected for processing (30)
  • executor/src/agents/codex.rs
  • executor/src/runtime_work/events.rs
  • executor/src/runtime_work/runtime_handle_messages.rs
  • executor/src/runtime_work/util.rs
  • wework/src/components/chat/AssistantMarkdown.tsx
  • wework/src/components/chat/FileChangesReviewPanel.test.tsx
  • wework/src/components/chat/FileChangesReviewPanel.tsx
  • wework/src/components/chat/MessageList.test.tsx
  • wework/src/components/chat/MessageList.tsx
  • wework/src/components/chat/RequestUserInputCard.test.tsx
  • wework/src/components/chat/RequestUserInputCard.tsx
  • wework/src/components/chat/ScrollableMessageArea.tsx
  • wework/src/components/chat/blocks/ToolBlocksDisplay.test.tsx
  • wework/src/components/chat/blocks/ToolBlocksDisplay.tsx
  • wework/src/components/chat/requestUserInputMessages.ts
  • wework/src/components/layout/DesktopWorkbenchLayout.test.tsx
  • wework/src/components/layout/DesktopWorkbenchMain.tsx
  • wework/src/components/layout/MobileWorkbenchLayout.test.tsx
  • wework/src/components/layout/MobileWorkbenchLayout.tsx
  • wework/src/components/layout/requestUserInputOverlay.test.ts
  • wework/src/components/layout/requestUserInputOverlay.ts
  • wework/src/components/layout/useWorkbenchPaneSession.ts
  • wework/src/components/layout/workspace-panels/RightWorkspacePanel.tsx
  • wework/src/components/layout/workspace-panels/useResizableWorkspacePanel.ts
  • wework/src/components/topnav/ChromeTitlebar.tsx
  • wework/src/components/topnav/TitlebarActionsPortal.tsx
  • wework/src/features/workbench/WorkbenchProvider.test.tsx
  • wework/src/features/workbench/runtimePaneMessages.ts
  • wework/src/i18n/locales/en/chat.json
  • wework/src/i18n/locales/zh-CN/chat.json

📝 Walkthrough

Walkthrough

This PR adds end-to-end "assistant plan" support. The Rust executor routes completed Codex plan items as final text output. The frontend detects plan-formatted content, renders it as an AssistantPlanCard with download/copy/expand actions, surfaces an implementation-confirmation request_user_input flow, and displays the expanded plan in a new right-workspace panel tab with Tauri titlebar portal sync. FileChangesReviewPanel also has its file-tree visibility toggle removed.

Changes

Assistant Plan Feature

Layer / File(s) Summary
Rust executor: plan item extraction and routing
executor/src/runtime_work/util.rs, executor/src/runtime_work/events.rs, executor/src/runtime_work/runtime_handle_messages.rs, executor/src/agents/codex.rs
Adds completed_plan_item_text helper; routes completed plan items as response.output_text.delta events; appends plan text to cached assistant messages; sets final_text in CodexRunState::append_completed_message; adds unit tests for all three paths.
Frontend plan detection and request-user-input utilities
wework/src/features/workbench/runtimePaneMessages.ts, wework/src/components/chat/requestUserInputMessages.ts, wework/src/components/layout/requestUserInputOverlay.ts, wework/src/components/layout/requestUserInputOverlay.test.ts
Adds isImplementationPlanRequestUserInput, applyRequestUserInputResponseToMessages, hasRequestUserInputResponse; updates isPendingRequestUserInputBlock; adds pendingImplementationPlanPayload fallback and plan-detection regexes; normalizes request_user_input render payloads; updates and expands tests.
RequestUserInputCard refactor: auto-submit, keyboard, summary
wework/src/components/chat/RequestUserInputCard.tsx, wework/src/components/chat/RequestUserInputCard.test.tsx
Extends payload with response aliases; adds formRef, auto-focus, handleKeyDown (Escape/Enter), selectOption with auto-submit, override-capable handleSubmit; adds exported RequestUserInputSummary; adds tests for implementation option, custom adjustment input, and keyboard flows.
AssistantPlanCard in MessageList and tag stripping
wework/src/components/chat/AssistantMarkdown.tsx, wework/src/components/chat/MessageList.tsx, wework/src/components/chat/ScrollableMessageArea.tsx, wework/src/i18n/locales/*/chat.json, wework/src/components/chat/MessageList.test.tsx
Strips <proposed_plan> tags in AssistantMarkdown; adds AssistantPlanCard with download/copy/expand actions; routes plan-matched content to AssistantPlanCard in AssistantMessage; threads onOpenAssistantPlan through MessageList and ScrollableMessageArea; adds plan_card and asked_count i18n strings; adds tests for tag stripping, request-user-input summary, and plan card interactions.
ToolBlocksDisplay: unified displayItems rendering
wework/src/components/chat/blocks/ToolBlocksDisplay.tsx, wework/src/components/chat/blocks/ToolBlocksDisplay.test.tsx
Introduces ProcessingDisplayItem union; replaces separate block/row memos with a single ordered displayItems memo; renders RequestUserInputSummary (answered) or RequestUserInputCard (pending) inline; removes the separate bottom request-user-input section; updates tests.
Right workspace plan panel, titlebar portal, and default width
wework/src/components/layout/workspace-panels/RightWorkspacePanel.tsx, wework/src/components/layout/workspace-panels/useResizableWorkspacePanel.ts, wework/src/components/topnav/TitlebarActionsPortal.tsx, wework/src/components/topnav/ChromeTitlebar.tsx
Extends RightWorkspacePanelView with 'plan'; adds PlanWorkspacePanel; reworks tab bar to support TitlebarRightPanelPortal; fixes default right-split chat width; adds TITLEBAR_RIGHT_PANEL_PORTAL_ID and TitlebarRightPanelPortal; updates ChromeTitlebar to render a CSS-variable-controlled right workspace zone with both portals.
Desktop/mobile layout wiring for plan and implementation confirmation
wework/src/components/layout/useWorkbenchPaneSession.ts, wework/src/components/layout/DesktopWorkbenchMain.tsx, wework/src/components/layout/MobileWorkbenchLayout.tsx, wework/src/features/workbench/WorkbenchProvider.test.tsx, wework/src/components/layout/DesktopWorkbenchLayout.test.tsx, wework/src/components/layout/MobileWorkbenchLayout.test.tsx
Extends sendRequestUserInputResponse with appendUserMessage/forceDefaultCollaborationMode options; replaces local message insertion with applyLocalRequestUserInputResponse; adds rightPanelPlanContent state, ResizeObserver width tracking, RightWorkspaceTitlebarLayoutSync, and implementation-plan-aware submission in desktop layout; updates mobile layout; adds tests for implementation confirmation runtime message, plan expansion, and updated geometry.

FileChangesReviewPanel: remove file-tree toggle

Layer / File(s) Summary
Remove file-tree visibility toggle from ReviewToolbar
wework/src/components/chat/FileChangesReviewPanel.tsx, wework/src/components/chat/FileChangesReviewPanel.test.tsx
Removes fileTreeVisibility state; derives fileTreeVisible directly from defaultFileTreeVisible prop; removes fileTreeVisible/onToggleFileTree from ReviewToolbar props and its toggle button; updates tests to assert toggle button absence.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant MessageList
  participant AssistantPlanCard
  participant DesktopWorkbenchMain
  participant useWorkbenchPaneSession
  participant Runtime

  User->>MessageList: views plan content message
  MessageList->>AssistantPlanCard: renders (isAssistantPlan=true)
  User->>AssistantPlanCard: clicks expand
  AssistantPlanCard->>DesktopWorkbenchMain: onOpenAssistantPlan(planContent)
  DesktopWorkbenchMain->>DesktopWorkbenchMain: setRightPanelPlanContent, selectPlanView
  DesktopWorkbenchMain->>RightWorkspacePanel: planContent, activeView='plan'

  User->>RequestUserInputCard: selects "implement" option (auto-submit)
  RequestUserInputCard->>useWorkbenchPaneSession: sendRequestUserInputResponse(response, {appendUserMessage:true, forceDefaultCollaborationMode:true})
  useWorkbenchPaneSession->>useWorkbenchPaneSession: applyLocalRequestUserInputResponse
  useWorkbenchPaneSession->>useWorkbenchPaneSession: getRuntimeModelFields({collaborationMode:'default'})
  useWorkbenchPaneSession->>Runtime: sendRuntimePaneMessage(userMessage, modelOptions)
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

  • wecode-ai/Wegent#1568: Modifies extract_text in executor/src/runtime_work/util.rs, which is called directly by the new completed_plan_item_text helper added in this PR.
  • wecode-ai/Wegent#1588: Modifies CodexRunState::append_completed_message and the item/completed notification routing in executor/src/runtime_work/events.rs, the same code paths extended by this PR's plan routing logic.

Poem

🐇 A plan arrives, tagged and bright,
The executor routes it right.
A card appears with copy and more,
Expand it wide — the right panel's your door.
"Implement!" clicks the bunny with glee,
The runtime hops forward, default-mode free! 🌿

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix_plan_mode

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.

@coderabbitai coderabbitai Bot mentioned this pull request Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant