fix(planner): resume the Claude conversation on reopen/restart instead of starting fresh (#2396) - #2428
Merged
Merged
Conversation
…ts (#2396) Reopening a project (or a sandbox-toggle relaunch) went through handleRestart, which hardcoded a plain `claude` launch — so the planner always started a fresh chat instead of resuming. Make handleRestart resume-capable by default, mirroring the mount path's launch exactly (`claude --continue 2>/dev/null || claude` + startupPromptFreshOnly + continueSession); only the destructive ops (clear-plan / switch-blueprint) pass an explicit `fresh: true` to launch a genuinely new session with the intro. - usePlanningSession: handleRestart takes `{ fresh?: boolean }`; doClearPlan/doSwitchBlueprint pass fresh: true; default carries the resume trio. - plannerLaunch: the Claude branch now requests continueSession: true (defensive — the backend ANDs it with real history), which also covers the mount launch in usePlannerTerminal via launch.continueSession. - pty_create: one resume-decision log line (has_history + resumed) so an "always fresh" regression is visible in the logs. - tests: lock the resume trio on handleRestart's default launch, the plain-fresh destructive path (direct + via doClearPlan), and the Claude-branch continueSession in plannerLaunchConfig. Closes #2396 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Reopening a project (or any non-destructive planner relaunch — sandbox toggle, header Restart) showed the planner's initial chat instead of resuming the prior Claude conversation:
handleRestarthardcoded a plainclaudelaunch with no--continue, no fresh-only intro suppression, nocontinueSession.handleRestartnow defaults to the mount path's resume trio (claude --continue 2>/dev/null || claude+startupPromptFreshOnly+continueSession); the destructive ops (clear-plan, switch-blueprint) pass an explicitfresh: trueand keep the plain-fresh launch.plannerLaunchConfigClaude branch setscontinueSession: true, covering the mount launch defensively (backend still ANDs it with actual history).pty_createlogs one resume-decision line (has_history+ resumed-vs-fresh) so an "always fresh" regression is visible in the app log.Verified: typecheck clean · lint 0 errors ·
cargo clippy --workspace --all-targets -- -D warningsclean.Closes #2396.
🤖 Generated with Claude Code