mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 12:11:24 +00:00
TUI: strip only leading inbound metadata (#22461)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { TUI } from "@mariozechner/pi-tui";
|
||||
import { stripInboundMetadata } from "../auto-reply/reply/strip-inbound-meta.js";
|
||||
import type { SessionsPatchResult } from "../gateway/protocol/index.js";
|
||||
import {
|
||||
normalizeAgentId,
|
||||
@@ -327,7 +326,7 @@ export function createSessionActions(context: SessionActionContext) {
|
||||
if (message.role === "user") {
|
||||
const text = extractTextFromMessage(message);
|
||||
if (text) {
|
||||
chatLog.addUser(stripInboundMetadata(text));
|
||||
chatLog.addUser(text);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user