fix(tui): preserve ExitPlanMode plan path after mode cycling (#1329)

Co-authored-by: Letta Code <noreply@letta.com>
This commit is contained in:
jnjpng
2026-03-10 13:26:29 -06:00
committed by GitHub
parent 4fda294a99
commit 58633e9557
2 changed files with 24 additions and 12 deletions

View File

@@ -12372,8 +12372,11 @@ ${SYSTEM_REMINDER_CLOSE}
const isLast = currentIndex + 1 >= pendingApprovals.length;
// Capture plan file path BEFORE exiting plan mode (for post-approval rendering)
const planFilePath = permissionMode.getPlanFilePath();
lastPlanFilePathRef.current = planFilePath;
const planFilePath =
permissionMode.getPlanFilePath() ?? lastPlanFilePathRef.current;
if (planFilePath) {
lastPlanFilePathRef.current = planFilePath;
}
// Exit plan mode
const restoreMode = acceptEdits
@@ -12484,16 +12487,6 @@ ${SYSTEM_REMINDER_CLOSE}
if (hasUsablePlan) {
// User likely cycled out of plan mode (e.g., Shift+Tab to acceptEdits/yolo)
// Keep approval flow alive and let ExitPlanMode proceed using fallback plan path.
const statusId = uid("status");
buffersRef.current.byId.set(statusId, {
kind: "status",
id: statusId,
lines: [
" Plan mode switched, continuing ExitPlanMode with saved plan file",
],
});
buffersRef.current.order.push(statusId);
refreshDerived();
return;
}