Skip to content

Commit ea93280

Browse files
authored
Merge pull request #55 from narumiruna/fix/plan-mode-discard-proposed-plan
fix(plan-mode): avoid appending discarded plans
2 parents 69a25e0 + ff879fe commit ea93280

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

extensions/pi-plan-mode/src/plan-mode.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ export default function planMode(pi: ExtensionAPI) {
186186
state = { ...state, latestPlan: proposedPlan, awaitingAction: true };
187187
persistState();
188188
updateUi(ctx);
189+
190+
if (ctx.hasUI) await showPlanReadyMenu(ctx);
191+
if (!state.enabled || !state.latestPlan) return;
192+
189193
pi.sendMessage(
190194
{
191195
customType: PROPOSED_PLAN_MESSAGE_TYPE,
@@ -194,8 +198,6 @@ export default function planMode(pi: ExtensionAPI) {
194198
},
195199
{ triggerTurn: false },
196200
);
197-
198-
if (ctx.hasUI) await showPlanReadyMenu(ctx);
199201
});
200202

201203
function enterPlanMode(ctx: ExtensionContext) {

0 commit comments

Comments
 (0)