feat(code): Add "clear and continue from plan" option in plan mode#1249
Open
littlekirkycode wants to merge 3 commits intoPostHog:mainfrom
Open
feat(code): Add "clear and continue from plan" option in plan mode#1249littlekirkycode wants to merge 3 commits intoPostHog:mainfrom
littlekirkycode wants to merge 3 commits intoPostHog:mainfrom
Conversation
added 3 commits
March 15, 2026 06:19
Adds /clear slash command that resets conversation history and starts a fresh session. Suppresses the SDK's built-in /clear (which doesn't work in our context) and replaces it with our own implementation. resetSession() now clears UI history by skipping log replay on reconnect.
Remove inline import in commands.ts. Rewrite resetSession() to create a new task run via createNewLocalSession() instead of clearing in-memory logs, ensuring old messages don't reappear on app restart.
Adds "Yes, clear history and continue from plan" option when exiting plan mode. Clears conversation history and re-injects the approved plan as the first prompt. Useful when context window is filling up during planning — lets the agent start fresh with just the plan.
ddb341b to
14b852f
Compare
4 tasks
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.
Closes #704
Summary
Adds a third option when exiting plan mode: "Yes, clear history and
continue from plan". Clears the conversation and re-sends the approved
plan as the first prompt — useful when the context window filled up
during planning and you want the agent to start implementing with maximum
available context.
Flow
Agent-side
The permission handler extracts the plan text and signals the renderer
via
extNotification:Renderer-side
SessionServicedetects the notification, queues the plan, and executesafter the turn completes:
The plan is queued (not executed immediately) because the notification
arrives mid-turn — we wait for the current turn to finish before
clearing.
Changes
acp-extensions.tsCLEAR_AND_CONTINUEnotification constantpermission-options.tsclearAndContinueoption to plan exit dialogpermission-handlers.tsclearAndContinue— switch mode, send notificationpackage.json./acp-extensionssubpathtsup.config.tsacp-extensions.tsbuild entryservice.tspendingPlanContinuationsmap, notification detection,executeClearAndContinue()Test plan
as first prompt
unchanged