feat(desktop): opt-in clear history and continue from plan - #78968
Closed
igennova wants to merge 4 commits into
Closed
feat(desktop): opt-in clear history and continue from plan#78968igennova wants to merge 4 commits into
igennova wants to merge 4 commits into
Conversation
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
igennova
marked this pull request as ready for review
August 6, 2026 14:38
Contributor
Author
|
@charlesvien opened this PR. You can review it when you have time. Thanks |
Member
Closes PostHog#704. Lets users discard planning context and start a fresh local run seeded with the approved plan, without changing resetSession.
Clear-and-continue built its own clearing: it cancelled the turn and started a fresh task run. That reset the chat thread, and it did nothing at all on cloud sessions. Use the adapter's /clear primitive instead. End the planning turn, clear the conversation, then send the approved plan into the fresh context. The task run, the ACP session and the visible thread all survive, and the thread keeps a "Conversation cleared" boundary above the implementation. Gate on the agent advertising conversationClear rather than skipping cloud sessions. An agent predating the capability ignores the boundary and rebuilds the conversation it was meant to retire, so fall back to a normal approve instead of showing a clear that did not happen. Extract the plan markdown before the clear and re-send it afterwards. /clear deliberately wipes the adapter's plan state, so the host's copy is the only thing that survives the boundary.
Contributor
Author
@charlesvien
|
Reading rawInput through an `as { plan?: unknown }` cast asserted a shape
nothing checked, so an upstream change would surface as a silent null and
quietly disable clear-and-continue. AGENTS.md asks for Zod-validated
metadata over raw SDK input.
Behavior is unchanged for well-formed and missing input alike. Cover the
wrong-typed plan the schema now rejects.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Author
|
Hey @charlesvien, why did this PR get closed by the trunk bot? |
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.
Ports PostHog/code#3961 onto the monorepo.
Summary
Why
Issue #76316: after planning, clearing context before implementation avoids auto-compaction mid-implementation. This mirrors Claude’s clear-on-plan-accept flow as an explicit choice.
How it works
cancelPrompt→createNewLocalSessionwith plan seedVideo
Screen.Recording.2026-07-15.at.12.49.28.PM.mov
Test plan
resetSessionunchanged)planContinuation,sessionServicePlanContinuation,permission-options,PlanApprovalSelectorReplaces PostHog/code#3462 , which was closed during the pre-migration PR sweep (not actually stale).
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
@igennova wrote this change and opened it as PostHog/code#3961 before the desktop repo moved into this monorepo. I (Claude) only ported it.
/porting-code-prs,/writing-pr-descriptions.git am -3 --directory=products/desktop/, which keeps the original commit authorship. Four files needed the 3-way fallback because the tree moved on, and all merged without conflicts.