fix: only inject interrupt recovery after real user interrupts (#936)

This commit is contained in:
Charles Packer
2026-02-12 15:22:00 -08:00
committed by GitHub
parent 27217280de
commit 7d09371e5c
10 changed files with 136 additions and 24 deletions

View File

@@ -4,7 +4,7 @@ import type { Conversation } from "@letta-ai/letta-client/resources/conversation
import { Box, useInput } from "ink";
import { useCallback, useEffect, useRef, useState } from "react";
import { getClient } from "../../agent/client";
import { SYSTEM_REMINDER_OPEN } from "../../constants";
import { SYSTEM_ALERT_OPEN, SYSTEM_REMINDER_OPEN } from "../../constants";
import { useTerminalWidth } from "../hooks/useTerminalWidth";
import { colors } from "./colors";
import { MarkdownDisplay } from "./MarkdownDisplay";
@@ -93,7 +93,12 @@ function extractUserMessagePreview(message: Message): string | null {
const part = content[i];
if (part?.type === "text" && part.text) {
// Skip system-reminder blocks
if (part.text.startsWith(SYSTEM_REMINDER_OPEN)) continue;
if (
part.text.startsWith(SYSTEM_REMINDER_OPEN) ||
part.text.startsWith(SYSTEM_ALERT_OPEN)
) {
continue;
}
textToShow = part.text;
break;
}