mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 16:44:33 +00:00
Agents: scope sanitizeUserFacingText rewrites to errorContext
Squash-merge #12988. Refs: #12889 #12309 #3594 #7483 #10094 #10368 #11317 #11359 #11649 #12022 #12432 #12676 #12711
This commit is contained in:
@@ -218,7 +218,10 @@ export function extractAssistantText(msg: AssistantMessage): string {
|
||||
.filter(Boolean)
|
||||
: [];
|
||||
const extracted = blocks.join("\n").trim();
|
||||
return sanitizeUserFacingText(extracted);
|
||||
// Only apply keyword-based error rewrites when the assistant message is actually an error.
|
||||
// Otherwise normal prose that *mentions* errors (e.g. "context overflow") can get clobbered.
|
||||
const errorContext = msg.stopReason === "error" || Boolean(msg.errorMessage?.trim());
|
||||
return sanitizeUserFacingText(extracted, { errorContext });
|
||||
}
|
||||
|
||||
export function extractAssistantThinking(msg: AssistantMessage): string {
|
||||
|
||||
Reference in New Issue
Block a user