fix: streaming flicker aggressive static promotion (#608)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2026-01-20 19:52:46 -08:00
committed by GitHub
parent 3bf43d7eb9
commit 271289a00b
5 changed files with 220 additions and 10 deletions

View File

@@ -16,6 +16,7 @@ type AssistantLine = {
id: string;
text: string;
phase: "streaming" | "finished";
isContinuation?: boolean;
};
/**
@@ -23,7 +24,7 @@ type AssistantLine = {
* This is a direct port from the old letta-code codebase to preserve the exact styling
*
* Features:
* - Left column (2 chars wide) with bullet point marker
* - Left column (2 chars wide) with bullet point marker (unless continuation)
* - Right column with wrapped text content
* - Proper text normalization
* - Support for markdown rendering (when MarkdownDisplay is available)
@@ -37,7 +38,7 @@ export const AssistantMessage = memo(({ line }: { line: AssistantLine }) => {
return (
<Box flexDirection="row">
<Box width={2} flexShrink={0}>
<Text></Text>
<Text>{line.isContinuation ? " " : "●"}</Text>
</Box>
<Box flexGrow={1} width={contentWidth}>
<MarkdownDisplay text={normalizedText} hangingIndent={0} />

View File

@@ -16,6 +16,7 @@ type ReasoningLine = {
id: string;
text: string;
phase: "streaming" | "finished";
isContinuation?: boolean;
};
/**
@@ -23,7 +24,7 @@ type ReasoningLine = {
* This is a direct port from the old letta-code codebase to preserve the exact styling
*
* Features:
* - Header row with "✻" symbol and "Thinking…" text
* - Header row with "✻" symbol and "Thinking…" text (unless continuation)
* - Reasoning content indented with 2 spaces
* - Full markdown rendering with dimmed colors
* - Proper text normalization
@@ -34,6 +35,20 @@ export const ReasoningMessage = memo(({ line }: { line: ReasoningLine }) => {
const normalizedText = normalize(line.text);
// Continuation lines skip the header, just show content
if (line.isContinuation) {
return (
<Box flexDirection="row">
<Box width={2} flexShrink={0}>
<Text> </Text>
</Box>
<Box flexGrow={1} width={contentWidth}>
<MarkdownDisplay text={normalizedText} dimColor={true} />
</Box>
</Box>
);
}
return (
<Box flexDirection="column">
<Box flexDirection="row">