mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 05:01:23 +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:
@@ -127,7 +127,9 @@ export async function runAgentTurnWithFallback(params: {
|
||||
if (!text) {
|
||||
return { skip: true };
|
||||
}
|
||||
const sanitized = sanitizeUserFacingText(text);
|
||||
const sanitized = sanitizeUserFacingText(text, {
|
||||
errorContext: Boolean(payload.isError),
|
||||
});
|
||||
if (!sanitized.trim()) {
|
||||
return { skip: true };
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ export function normalizeReplyPayload(
|
||||
}
|
||||
|
||||
if (text) {
|
||||
text = sanitizeUserFacingText(text);
|
||||
text = sanitizeUserFacingText(text, { errorContext: Boolean(payload.isError) });
|
||||
}
|
||||
if (!text?.trim() && !hasMedia && !hasChannelData) {
|
||||
opts.onSkip?.("empty");
|
||||
|
||||
Reference in New Issue
Block a user