TUI: strip only leading inbound metadata (#22461)

This commit is contained in:
Vincent Koc
2026-02-21 01:13:02 -05:00
committed by GitHub
parent 59167f86ca
commit 45fff13b1d
3 changed files with 49 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
import { formatRawAssistantErrorForUi } from "../agents/pi-embedded-helpers.js";
import { stripInboundMetadata } from "../auto-reply/reply/strip-inbound-meta.js";
import { stripLeadingInboundMetadata } from "../auto-reply/reply/strip-inbound-meta.js";
import { stripAnsi } from "../terminal/ansi.js";
import { formatTokenCount } from "../utils/usage-format.js";
@@ -275,7 +275,7 @@ export function extractTextFromMessage(
const text = extractTextBlocks(record.content, opts);
if (text) {
if (record.role === "user") {
return stripInboundMetadata(text);
return stripLeadingInboundMetadata(text);
}
return text;
}