fix: streaming flicker aggressive static promotion (#608)
Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
@@ -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} />
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user