diff --git a/extensions/discord/src/monitor/message-handler.process.ts b/extensions/discord/src/monitor/message-handler.process.ts index 3de01b7364ad..70205ed9d9c6 100644 --- a/extensions/discord/src/monitor/message-handler.process.ts +++ b/extensions/discord/src/monitor/message-handler.process.ts @@ -625,7 +625,7 @@ async function processDiscordMessageInner( ) => { if (isProcessAborted(abortSignal)) { // Surface so operators don't chase missing replies when an abort - // drops a model-produced text payload (see PR for the incident). + // drops a model-produced text payload. logVerbose( formatDiscordReplySkip({ kind: info.kind, diff --git a/src/agents/embedded-agent-helpers.sanitizeuserfacingtext.test.ts b/src/agents/embedded-agent-helpers.sanitizeuserfacingtext.test.ts index bb33b088d5b7..22fd8249c224 100644 --- a/src/agents/embedded-agent-helpers.sanitizeuserfacingtext.test.ts +++ b/src/agents/embedded-agent-helpers.sanitizeuserfacingtext.test.ts @@ -308,6 +308,7 @@ describe("sanitizeUserFacingText", () => { const input = [ "Visible intro.", "โš ๏ธ ๐Ÿ› ๏ธ `run openclaw definitely-not-a-real-subcommand (agent)` failed", + "โš ๏ธ ๐Ÿ› ๏ธ gh search issues --repo openclaw/openclaw --state open --no-search-pages.jsonl /tmp/openclaw_open_unlabeled_current.json (agent) failed", "๐Ÿ› ๏ธ run git status", "๐Ÿ“– Read: lines 1-40 from secret.md", "Visible outro.", diff --git a/src/shared/text/assistant-visible-text.test.ts b/src/shared/text/assistant-visible-text.test.ts index a1f3c8582a53..fe8ffeb9550a 100644 --- a/src/shared/text/assistant-visible-text.test.ts +++ b/src/shared/text/assistant-visible-text.test.ts @@ -834,6 +834,7 @@ describe("sanitizeAssistantVisibleText", () => { const input = [ "Visible intro.", "โš ๏ธ ๐Ÿ› ๏ธ `run openclaw definitely-not-a-real-subcommand (agent)` failed", + "โš ๏ธ ๐Ÿ› ๏ธ gh search issues --repo openclaw/openclaw --state open --no-search-pages.jsonl /tmp/openclaw_open_unlabeled_current.json (agent) failed", "๐Ÿ› ๏ธ run git status", "Visible outro.", ].join("\n"); diff --git a/src/shared/text/assistant-visible-text.ts b/src/shared/text/assistant-visible-text.ts index c7427469629c..4cb71935ee8b 100644 --- a/src/shared/text/assistant-visible-text.ts +++ b/src/shared/text/assistant-visible-text.ts @@ -15,8 +15,10 @@ const INTERNAL_TRACE_LINE_QUICK_RE = /(?:๐Ÿ“Š|๐Ÿ› ๏ธ|๐Ÿ“–|๐Ÿ“|๐Ÿ”|๐Ÿ”Ž|โš™๏ธ|tool[-_ ]?call|tool[-_ ]?result|function[-_ ]?call)/i; const INTERNAL_TRACE_LINE_RE = /^(?:>\s*)?(?:โš ๏ธ\s*)?(?:๐Ÿ“Š|๐Ÿ› ๏ธ|๐Ÿ“–|๐Ÿ“|๐Ÿ”|๐Ÿ”Ž|โš™๏ธ)\s*(?:Session Status|Exec|Read|Edit|Write|Patch|Search|Open|Click|Find|Screenshot|Update Plan|Tool Call|Tool Result|Function Call|Shell|Command)\s*:/i; +const INTERNAL_COMPACT_FAILURE_TRACE_LINE_RE = + /^(?:>\s*)?โš ๏ธ\s*๐Ÿ› ๏ธ\s+\S[\s\S]*\s+\(agent\)`{0,2}\s+failed\s*$/i; const INTERNAL_COMPACT_COMMAND_TRACE_LINE_RE = - /^(?:>\s*)?(?:โš ๏ธ\s*)?๐Ÿ› ๏ธ\s*(?:(?:(?:elevated|pty)\b\s*(?:ยท|,)\s*)+)?(?:`{1,2}\s*\S|(?:run|check|fetch|pull|push|view|show|list|switch|create|merge|rebase|stage|restore|reset|stash|search|find|print|copy|move|remove|install|start|cd|git|pnpm|npm|yarn|bun|node|python|python3|bash|sh)\b)/i; + /^(?:>\s*)?๐Ÿ› ๏ธ\s*(?:(?:(?:elevated|pty)\b\s*(?:ยท|,)\s*)+)?(?:`{1,2}\s*\S|(?:run|check|fetch|pull|push|view|show|list|switch|create|merge|rebase|stage|restore|reset|stash|search|find|print|copy|move|remove|install|start|cd|git|pnpm|npm|yarn|bun|node|python|python3|bash|sh)\b)/i; const INTERNAL_CHANNEL_TRACE_LINE_RE = /^(?:>\s*)?(?:tool[-_ ]?call|tool[-_ ]?result|function[-_ ]?call)\s*[:=]/i; @@ -785,6 +787,7 @@ export function stripAssistantInternalTraceLines(text: string): string { const shouldStrip = !isInsideCode(lineStart, codeRegions) && (INTERNAL_TRACE_LINE_RE.test(trimmed) || + INTERNAL_COMPACT_FAILURE_TRACE_LINE_RE.test(trimmed) || INTERNAL_COMPACT_COMMAND_TRACE_LINE_RE.test(trimmed) || INTERNAL_CHANNEL_TRACE_LINE_RE.test(trimmed)); if (!shouldStrip) {