Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .pi/extensions/build-plan-mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@ export default function buildPlanMode(pi: ExtensionAPI) {
if (ctx) persistStateToFile(ctx.cwd);
}

function seedModeState() {
pi.appendEntry(STATE_TYPE, { mode });
}

function emitModelConfig() {
pi.events.emit(MODEL_CONFIG_EVENT, { ...modelMap });
}
Expand Down Expand Up @@ -956,6 +960,10 @@ export default function buildPlanMode(pi: ExtensionAPI) {
pi.setActiveTools(pi.getAllTools().map(t => t.name));
}

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.

}

updateStatus(ctx);
});

Expand Down