From 4ba0a4d4fb852e010c53d2e011b961f7337633e4 Mon Sep 17 00:00:00 2001 From: pushkarsingh32 Date: Sun, 1 Mar 2026 20:53:50 +0530 Subject: [PATCH] fix(slack): wrap session key in backticks to prevent emoji shortcode parsing (openclaw#30266) thanks @pushkarsingh32 Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: pushkarsingh32 <29558481+pushkarsingh32@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> --- CHANGELOG.md | 1 + src/auto-reply/reply/agent-runner.misc.runreplyagent.test.ts | 2 +- src/auto-reply/reply/agent-runner.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0eb558c814b..f65919e578f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -92,6 +92,7 @@ Docs: https://docs.openclaw.ai - Cron/Schedule errors: notify users when a job is auto-disabled after repeated schedule computation failures. (#29098) Thanks . - File tools/tilde paths: expand `~/...` against the user home directory before workspace-root checks in host file read/write/edit paths, while preserving root-boundary enforcement so outside-root targets remain blocked. (#29779) Thanks @Glucksberg. - Slack/HTTP mode startup: treat Slack HTTP accounts as configured when `botToken` + `signingSecret` are present (without requiring `appToken`) in channel config/runtime status so webhook mode is not silently skipped. (#30567) +- Slack/Usage footer formatting: wrap session keys in inline code in full response-usage footers so Slack does not parse colon-delimited session segments as emoji shortcodes. (#30258) Thanks @pushkarsingh32. - Onboarding/Custom providers: raise default custom-provider model context window to the runtime hard minimum (16k) and auto-heal existing custom model entries below that threshold during reconfiguration, preventing immediate `Model context window too small (4096 tokens)` failures. (#21653) Thanks @r4jiv007. - Web UI/Assistant text: strip internal `...` scaffolding from rendered assistant messages (while preserving code-fence literals), preventing memory-context leakage in chat output for models that echo internal blocks. (#29851) Thanks @Valkster70. - Dashboard/Sessions: allow authenticated Control UI clients to delete and patch sessions while still blocking regular webchat clients from session mutation RPCs, fixing Dashboard session delete failures. (#21264) Thanks @jskoiz. diff --git a/src/auto-reply/reply/agent-runner.misc.runreplyagent.test.ts b/src/auto-reply/reply/agent-runner.misc.runreplyagent.test.ts index 0803e5ea2cd..21e1d76820c 100644 --- a/src/auto-reply/reply/agent-runner.misc.runreplyagent.test.ts +++ b/src/auto-reply/reply/agent-runner.misc.runreplyagent.test.ts @@ -1391,7 +1391,7 @@ describe("runReplyAgent response usage footer", () => { const res = await createRun({ responseUsage: "full", sessionKey }); const payload = Array.isArray(res) ? res[0] : res; expect(String(payload?.text ?? "")).toContain("Usage:"); - expect(String(payload?.text ?? "")).toContain(`· session ${sessionKey}`); + expect(String(payload?.text ?? "")).toContain(`· session \`${sessionKey}\``); }); it("does not append session key when responseUsage=tokens", async () => { diff --git a/src/auto-reply/reply/agent-runner.ts b/src/auto-reply/reply/agent-runner.ts index 28091a7a9f8..1ae1b36f18a 100644 --- a/src/auto-reply/reply/agent-runner.ts +++ b/src/auto-reply/reply/agent-runner.ts @@ -605,7 +605,7 @@ export async function runReplyAgent(params: { costConfig, }); if (formatted && responseUsageMode === "full" && sessionKey) { - formatted = `${formatted} · session ${sessionKey}`; + formatted = `${formatted} · session \`${sessionKey}\``; } if (formatted) { responseUsageLine = formatted;