fix: properly handle ctrl-c during plan mode, and restoring on pending plan approval (#529)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2026-01-12 22:28:51 -08:00
committed by GitHub
parent a0f604b5f0
commit 3ba63748c3
2 changed files with 48 additions and 7 deletions

View File

@@ -9,6 +9,7 @@ type Props = {
onApprove: () => void;
onApproveAndAcceptEdits: () => void;
onKeepPlanning: (reason: string) => void;
onCancel: () => void; // For CTRL-C to queue denial (like other approval screens)
isFocused?: boolean;
};
@@ -28,6 +29,7 @@ export const StaticPlanApproval = memo(
onApprove,
onApproveAndAcceptEdits,
onKeepPlanning,
onCancel,
isFocused = true,
}: Props) => {
const [selectedOption, setSelectedOption] = useState(0);
@@ -50,9 +52,9 @@ export const StaticPlanApproval = memo(
(input, key) => {
if (!isFocused) return;
// CTRL-C: keep planning with cancel message
// CTRL-C: cancel and queue denial (like other approval screens)
if (key.ctrl && input === "c") {
onKeepPlanning("User pressed CTRL-C to cancel");
onCancel();
return;
}