Repository navigation
Conversation
added 2 commits
October 5, 2026 12:08
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Both parts of #13340 in one draft PR, per the plan discussed with @doudouOUC in that thread.
1. Web Shell: render the ExitPlanMode approval as markdown
packages/web-shell/client/components/messages/ToolApproval.tsxrendered the plan as a raw<pre>{contentText}</pre>, so the markdown the model writes (theexit_plan_modeschema itself declares "Supports markdown") showed up as literal##/#lines in a fixed-height box.The
isExitPlanApprovalbranch now renders the plan with the existingMarkdownprimitive (react-markdown + remark-gfm, with theisSafeHref/isSafeImageSrcsanitisation that matters for model-generated content). The.planContentheight clamp is kept, and the raw plan text remains available as the element'stitleplus the rendered plain text, so the alertdialog'saria-describedbykeeps a plain-text accessible equivalent. Non-plan content paths still use<pre>.2. Core: make the plan-mode reminder ask for a Todo list when Session Workflow is on
getPlanModeSystemReminder()never mentionedtodo_write, so withexperimental.sessionWorkflowenabled the model almost always wrote a text plan and the structured DAG approval path (planTodos.length > 0) was effectively unreachable (documented in #8393).getPlanModeSystemRemindernow takes asessionWorkflowparameter; when it is true (and the interactive exit-plan flow applies, i.e. not plan-only mode) the "When to Converge" section instructs the model to capture the plan as a structured Todo list viatodo_write(stable ids,blockedByfor real dependencies) before callingexit_plan_mode.client.ts(per-turn reminder),enterPlanMode.ts(toolllmContent), the ACP session (Session.ts) andnonInteractiveHelpers.ts— all viaconfig.isSessionWorkflowTodoContextActive?.() === true, the same sourcetodo_writealready uses for itssessionWorkflowstamp.plan-mode-entry-policy.tsnow also precomputes the session-workflow variant so the tool-response budget protection keeps matchingenter_plan_modeoutput.Plan-only mode (SDK/subagent contexts, which never run the interactive exit-plan approval) is unchanged.
Tests
ToolApproval.test.tsx: new test — the plan renders as markdown (real<h2>/<li>, no raw<pre>, plain-text equivalent preserved for a11y).prompts.test.ts: new tests — the session-workflow reminder contains the Todo instruction in the right order; the gate-off and plan-only variants stay text-only; the new variant is exactly the base reminder plus one inserted sentence.client.test.ts: updated the call assertion for the new argument.Local run (vitest, node v26.5.0):
packages/web-shell:ToolApproval.test.tsx— 81 passedpackages/core:prompts.test.ts— 205 passed;client.test.ts+coreToolScheduler.test.ts— 956 passed;plan-mode-entry-policy.test.ts+enterPlanMode.test.ts+tool-response-finalizer.test.ts— 59 passedtsc --noEmitclean inweb-shellandcoreNotes