test: isolate local media regression fixtures to allowed roots (#22369)

* fix(tui): strip inbound metadata blocks from user text

* chore: clean up metadata-strip format and changelog credit

* chore: format tui metadata-strip tests

* test(web): isolate local media fixture paths to allow-listed roots
This commit is contained in:
Vincent Koc
2026-02-20 18:50:50 -08:00
committed by GitHub
parent 9a6b26d427
commit d94d21f9b0
5 changed files with 64 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
import { formatRawAssistantErrorForUi } from "../agents/pi-embedded-helpers.js";
import { stripInboundMetadataBlocks } from "../shared/chat-envelope.js";
import { stripAnsi } from "../terminal/ansi.js";
import { formatTokenCount } from "../utils/usage-format.js";
@@ -273,6 +274,9 @@ export function extractTextFromMessage(
const record = message as Record<string, unknown>;
const text = extractTextBlocks(record.content, opts);
if (text) {
if (record.role === "user") {
return stripInboundMetadataBlocks(text);
}
return text;
}