Skip to content

fix(build-plan-mode): seed mode state on startup/new sessions#3

Merged
julsemaan merged 1 commit into
masterfrom
fix-resume-mode
Jul 15, 2026
Merged

fix(build-plan-mode): seed mode state on startup/new sessions#3
julsemaan merged 1 commit into
masterfrom
fix-resume-mode

Conversation

@julsemaan

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Pi build-plan-mode extension to ensure the session’s “mode” is persisted early for fresh sessions, so subsequent resumes/reloads can reliably restore the intended default mode behavior.

Changes:

  • Add a small helper (seedModeState) that writes an initial state entry containing the selected mode.
  • On session_start, when there is no prior state entry and the reason is startup or new, seed the mode state before updating the status UI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

if (!lastState && (event.reason === "startup" || event.reason === "new")) {
seedModeState();

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not seedModeEstate?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kept seedModeState(). It only writes { mode } as minimal bootstrap state, while persistState() writes full app state (mode/profile/modelMap). seedModeEstate feels less clear than current name for that narrower behavior.

@julsemaan
julsemaan merged commit 5e3fec4 into master Jul 15, 2026
2 checks passed
@julsemaan
julsemaan deleted the fix-resume-mode branch July 15, 2026 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants