Skip to content

feat(clients): bring back Plan mode as a Labs opt-in - #1

Open
SHAMALKRISHNA wants to merge 8 commits into
mainfrom
feat/restore-plan-mode
Open

SHAMALKRISHNA wants to merge 8 commits into
mainfrom
feat/restore-plan-mode

Conversation

@SHAMALKRISHNA

Copy link
Copy Markdown
Owner

Upstream pingdotgg#33131 removed Plan mode from the clients: the Build/Plan toggle, /plan, /default, Shift+Tab, and the plan follow-up with "Implement in a new thread". The server still supports Plan mode, but people in the composer can't reach it.

This brings it back as an opt-in: Settings → Labs → Plan mode, off by default. With it off, the clients behave like upstream main.

  • Web, desktop and mobile: the toggle, /plan and /default, Shift+Tab, queued sends and side chats keep the mode, and the plan follow-up offers Refine, Implement, and Implement in a new thread.
  • Rebased onto current upstream main (e9e934bb). One extra commit wires the new props into tests added upstream since the rebase.

Checks: vp run check:changed passes for format, lint, knip, typecheck (37 packages) and the react compiler. The test step had 39 files passing with 0 failed assertions; three browser files ran 0 tests because Vite re-optimized two dependencies partway through and reloaded. Those three pass on their own, and all 12 changed browser files pass together (58/58).

Runtime (isolated dev server): on upstream main, /plan says "No matching command". On this branch, /plan switches Build to Plan. It works with Replay (dev) and with OpenCode 2 on DeepSeek via OpenRouter; the plan agent planned and edited no files.

Not reviewed by a second model yet. Merge not authorized.

Tracking: MYK-631.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XcrufoToQXAiwq9sFnSPYU

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL labels Nov 12, 2026
@github-actions

Copy link
Copy Markdown

This PR changes the test suite by +84 test cases (browser +31, unit +53, server 0).

New browser test files: apps/web/src/components/ChatView.appMessage.browser.test.tsx, apps/web/src/components/ChatView.planMode.browser.test.tsx, apps/web/src/components/ChatView.planModeProviderCommands.browser.test.tsx, apps/web/src/components/chat/useLeavePlanModeWhenOptedOut.browser.test.tsx, apps/web/src/components/chat/useSideChat.browser.test.tsx.
Each browser test file costs CI seconds of module loading before its first test runs; a unit test costs milliseconds.

Keep tests that would fail for a real reason, and test logic below the UI where it can be. See Testing.

@SHAMALKRISHNA

Copy link
Copy Markdown
Owner Author

Note

🤖 Opus 5.5 responding on behalf of Sam

Before/after screenshots and the verified checks for this PR are on one page (private; Sam can open it): https://claude.ai/artifact/MntMFcGJKaKJQQA6SUpJGz

Upstream merged 5 PRs after this branch's base e9e934bb, so this stack is 5 commits behind pingdotgg/t3code main. Rebase before merging.

SHAMALKRISHNA and others added 8 commits November 13, 2026 02:35
Independent review of the Plan mode restoration found nine bugs.

Web:
- An inline /plan or /default now sets the draft's mode, so the next
  message and a retry after a failed send keep it.
- /plan typed over a shown approval is sent as that reply's text.
- The slash menu no longer offers /plan or /default while an approval
  or question is showing, so a pick cannot erase the reply.
- Implement in a new thread uses the source thread's runtime mode
  instead of the project default, which could drop its approvals.
- Enter on an empty composer no longer implements the plan while Resume
  is the primary action, and the placeholder stops promising it.
- A typed /plan or /default works with multiple models selected.

Mobile:
- Thread sends and resumes run in default mode unless Plan mode is on.
- The /plan and /default menu entries need the opt-in and no pending
  approval.

Both: provider /plan and /default entries are hidden while T3's are
offered, because the send path would consume that text anyway.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mobile:
- /plan and /default stay literal, and the menu entries stay hidden,
  while a question or approval is pending. Answers typed in the question
  card were already literal; this covers the composer's own paths.
- Work locally restarts a thread through a helper that applies the
  Plan mode opt-in instead of sending the stored mode.

Web:
- A standalone /plan or /default switches modes before the check for
  whether multiple models can start, since it starts nothing. A message
  on a draft that cannot start still stops at the warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sumes

The server runs a turn in the thread's saved mode, so anything that
reaches it without first saving the opted-in mode can run in plan.

Mobile:
- Outbox delivery resolves every queued message through the opt-in. With
  Plan mode off or not yet loaded, a message saved with no mode on a plan
  thread, and a message carrying plan, both go out in default. The drain
  reads the preference and passes it to each send.
- Resuming a held queue saves the mode first.

Web:
- Resuming a held queue saves the mode first and keeps the thread's
  runtime mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A turn on an existing thread runs in the thread's saved mode, so these
two sends could run in plan with the opt-in off.

Web:
- An app's message saves the composer's mode first. The thread's
  runtime mode is left alone, and a failed save stops the send.

Web and mobile:
- A side chat's first message saves default first, because the server's
  fork copies the source thread's mode. A failed save drops the side chat.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mobile outbox:
- Nothing is sent or saved until preferences have loaded.
- A failed preferences read used to look like "never opted in". The read
  now keeps the failure beside the value, so the two change together and
  a retry never passes through "opted out" on the way.
- While the setting can't be read, a message that would run in plan waits
  in the queue with a note in its composer, and the read is retried.
  Changing Plan Mode in Settings releases it at once. Messages that run
  in default either way still send.

Starting a run from a held queue or a guest message:
- These start a run in the thread's saved mode without passing one. With
  the opt-in off, a plan thread is saved as default first, the same as
  resume and side chats. Web: queue Send now, guest Send. Mobile: queue
  Send now, Resume queue, guest Send.
- On mobile, an unreadable setting refuses these with an alert, and so
  does the thread's resume action on a plan thread.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The map's comment ran into the comment above the drain flags, which read
as one five-line comment and broke the comment-length lint rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rebase

Upstream's new ComposerPrimaryActions and modelSelection tests predate the
Plan mode props, and both sides of the rebase imported the same error type
in the fake environment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SHAMALKRISHNA

SHAMALKRISHNA commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner Author

Note

🤖 Opus 5.5 responding on behalf of Sam

Rebased on upstream main 4fd40e1a, and the fork's main is level with it again. New head aa97859b. All 8 commits carry the same patches, and none of upstream's 5 new commits touches our files.

Checks on aa97859b:

  • Pass: format, lint, knip, typecheck (37 packages), react compiler.
  • The 12 changed browser test files: 71/71 pass. The same files on the old head d29881ed also pass 71/71 under the same load.
  • Not re-run on the new head: the non-browser tests and 6 unchanged browser files. Running all 49 files in one batch timed out on a loaded Air (9 browser tests timed out, mostly in files this PR does not touch).

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

Labels

size:XXL 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