Skip to content

fix(mattermost): strip internal tool-trace banners from outbound text#98693

Merged
steipete merged 2 commits into
openclaw:mainfrom
ZengWen-DT:fix/mattermost-outbound-tool-trace
Jul 7, 2026
Merged

fix(mattermost): strip internal tool-trace banners from outbound text#98693
steipete merged 2 commits into
openclaw:mainfrom
ZengWen-DT:fix/mattermost-outbound-tool-trace

Conversation

@ZengWen-DT

@ZengWen-DT ZengWen-DT commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Mattermost replies can include internal assistant tool-trace failure banners such as ⚠️ 🛠️ ... (agent) failed when the agent output contains delivery-internal scaffolding. Other text-channel outbound adapters already strip this scaffolding via sanitizeAssistantVisibleText before delivery, but the Mattermost outbound adapter had no sanitizeText hook, so the internal banner could be posted to a Mattermost channel as ordinary user-visible text.

Part of #90684 (apply sanitizeAssistantVisibleText() on non-Discord outbound text).

AI-assisted.

Why This Change Was Made

The Mattermost outbound adapter now applies the existing sanitizeAssistantVisibleText delivery sanitizer through the standard ChannelOutboundAdapter.sanitizeText hook, matching the established outbound delivery boundary already used by sibling text channels such as Slack, Telegram, Google Chat, IRC, and SMS. The change is a one-line hook plus a focused test; it does not alter Mattermost transport, targeting, chunking, presentation buttons, or config semantics.

User Impact

Mattermost users receive the intended assistant reply text instead of internal tool-trace diagnostics. Ordinary Markdown prose and outbound chunking behavior are preserved.

Evidence

Before, the Mattermost outbound adapter exposed no sanitizer, so the shared delivery handler passed tool-trace scaffolding to the Mattermost message adapter. The final regression now drives the real handler boundary rather than calling the sanitizer seam directly:

deliverOutboundPayloads
  -> Mattermost outbound sanitizeText
  -> Mattermost channel message adapter
  -> sendMessageMattermost mock

At exact head 7d8ae06586990f68c002d02ad53791c22288cc64, the transport mock receives Done. for an input containing a standalone internal agent trace, and receives ordinary assistant prose unchanged.

$ oxfmt --check extensions/mattermost/src/channel.ts extensions/mattermost/src/outbound-delivery.test.ts
All matched files use the correct format.

Exact-head secretless CI passed all 47 successful jobs with no failures:

https://github.com/openclaw/openclaw/actions/runs/28841899858

Fresh Codex autoreview also completed clean with no accepted/actionable findings (confidence 0.94). Repo-native OPENCLAW_TESTBOX=1 scripts/pr prepare-run 98693 accepted the exact-head hosted gates.

No live Mattermost post was sent: the bug is fully decided before network I/O, and the handler-to-transport integration test proves the exact bytes handed to the Mattermost send primitive without creating a public channel message.

@openclaw-barnacle openclaw-barnacle Bot added channel: mattermost Channel integration: mattermost size: XS labels Jul 1, 2026
@clawsweeper

clawsweeper Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 1, 2026, 11:51 AM ET / 15:51 UTC.

Summary
Adds a Mattermost outbound sanitizeText hook using sanitizeAssistantVisibleText plus a focused test for stripping internal tool-trace banners while preserving normal prose.

PR surface: Source +2, Tests +19. Total +21 across 2 files.

Reproducibility: yes. Source inspection shows current main and v2026.6.11 Mattermost outbound lacks sanitizeText, while the shared delivery path only calls a sanitizer when the adapter supplies one; the PR body includes direct before/after adapter proof.

Review metrics: 1 noteworthy metric.

  • Mattermost sanitizer hook: 1 added. The PR changes the user-visible text normalization path for Mattermost outbound payloads before transport delivery.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #90684
Summary: This PR is a Mattermost-specific candidate fix for the broader open non-Discord outbound sanitizer issue; sibling channel PRs cover adjacent slices of the same leak class.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Risk before merge

  • [P1] This intentionally changes Mattermost-visible text before send; the shared sanitizer is already used by sibling channels, but maintainers should accept that Mattermost Markdown lines matching internal tool-trace patterns may now be suppressed.

Maintainer options:

  1. Land the Mattermost hook (recommended)
    Accept the same sanitizer boundary already merged for sibling text channels and use the direct adapter proof plus green CI as enough for this Mattermost slice.
  2. Ask for delivery-path proof
    Have the contributor add or show a deliverOutboundPayloads-level Mattermost proof if maintainers want coverage beyond the direct adapter output before merge.
  3. Defer to the broader sanitizer issue
    Pause this slice if maintainers prefer to resolve all remaining non-Discord channels through the broader canonical sanitizer boundary instead of more per-channel hooks.

Next step before merge

  • [P2] There is no concrete repair finding for automation; the remaining action is maintainer review of the narrow Mattermost sanitizer change and its message-delivery risk.

Security
Cleared: The diff only adds an existing SDK sanitizer hook and a focused test; it does not change secrets, dependencies, workflows, permissions, package resolution, or code execution paths.

Review details

Best possible solution:

Land the narrow Mattermost hook if maintainers accept the established per-channel sanitizer behavior, while keeping the broader non-Discord coverage tracked by #90684.

Do we have a high-confidence way to reproduce the issue?

Yes. Source inspection shows current main and v2026.6.11 Mattermost outbound lacks sanitizeText, while the shared delivery path only calls a sanitizer when the adapter supplies one; the PR body includes direct before/after adapter proof.

Is this the best way to solve the issue?

Yes for this channel slice. A shared global sanitizer remains a broader maintainer decision, but adding the existing per-channel hook to Mattermost is the narrow owner-boundary fix that matches merged sibling channels without new config.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against adcfebc276cc.

Label changes

Label justifications:

  • P1: The PR addresses internal tool/runtime scaffolding leaking into an external chat channel, which is an urgent user-facing channel workflow and privacy problem.
  • merge-risk: 🚨 message-delivery: Adding a Mattermost outbound sanitizer can intentionally suppress message text that matches internal tool-trace patterns before delivery.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes copied terminal output from the real Mattermost plugin adapter after the change, plus focused test output; a live Mattermost round-trip is not necessary for this pre-send sanitizer seam.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes copied terminal output from the real Mattermost plugin adapter after the change, plus focused test output; a live Mattermost round-trip is not necessary for this pre-send sanitizer seam.
Evidence reviewed

PR surface:

Source +2, Tests +19. Total +21 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 2 0 +2
Tests 1 19 0 +19
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 21 0 +21

What I checked:

  • Current Mattermost adapter has no sanitizer on main: mattermostOutbound on current main defines chunking, limits, delivery capabilities, presentation rendering, and send hooks, but no sanitizeText hook, so the shared delivery sanitizer stage has nothing Mattermost-specific to call. (extensions/mattermost/src/channel.ts:625, adcfebc276cc)
  • Shared delivery calls channel sanitizers only when provided: createPluginHandler maps outbound.sanitizeText into the delivery handler, and normalizePayloadsForChannelDelivery applies it before delivery only when present. (src/infra/outbound/deliver.ts:390, adcfebc276cc)
  • PR adds the expected Mattermost hook: The PR imports sanitizeAssistantVisibleText from the plugin SDK text-chunking subpath and adds sanitizeText: ({ text }) => sanitizeAssistantVisibleText(text) to mattermostOutbound. (extensions/mattermost/src/channel.ts:628, dce31a1f056f)
  • Focused regression test added: The PR adds a Mattermost test that expects the internal ⚠️ 🛠️ ... (agent) failed banner to be removed and ordinary assistant prose to be preserved. (extensions/mattermost/src/outbound-tool-trace-sanitize.test.ts:1, dce31a1f056f)
  • Sibling channels use the same sanitizer pattern: Slack, Telegram, and Matrix current-main outbound adapters already expose sanitizeText using sanitizeAssistantVisibleText, with matching tool-trace regression coverage in sibling tests. (extensions/slack/src/channel.ts:427, adcfebc276cc)
  • Latest release still lacks Mattermost coverage: v2026.6.11 contains mattermostOutbound without sanitizeText, so the central Mattermost problem is not already shipped. (extensions/mattermost/src/channel.ts:625, e085fa1a3ffd)

Likely related people:

  • vincentkoc: Recent current-main history for extensions/mattermost/src/channel.ts includes Mattermost attachment routing and threaded delivery fixes adjacent to this outbound adapter. (role: recent Mattermost contributor; confidence: high; commits: 56a7000b3efa, 2365a137d88c, c67dc59b02b0; files: extensions/mattermost/src/channel.ts)
  • steipete: History shows shared assistant-visible sanitizer work and Mattermost presentation/plugin-SDK refactors that define the boundary this PR uses. (role: shared sanitizer and plugin-SDK adjacent owner; confidence: medium; commits: b78c2ee8c850, 1507a9701b83, 29b5563ccda2; files: extensions/mattermost/src/channel.ts, src/shared/text/assistant-visible-text.ts, src/plugin-sdk/text-chunking.ts)
  • masatohoshino: Merged Slack, Matrix, and Signal sanitizer slices use the same sanitizeText pattern and tests that this Mattermost PR mirrors. (role: sibling sanitizer contributor; confidence: medium; commits: cd6d0f9b00f0, 25490d4c4212; files: extensions/slack/src/channel.ts, extensions/matrix/src/channel.ts, extensions/signal/src/channel.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jul 1, 2026
@steipete steipete self-assigned this Jul 7, 2026
@steipete

steipete commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Land-ready maintainer proof for exact head 7d8ae06586990f68c002d02ad53791c22288cc64:

  • Best-fix verdict: the Mattermost outbound adapter is the correct owner boundary. Sanitizing inside sendMessageMattermost would mix assistant policy into the transport primitive; changing generic delivery policy would alter unrelated channel rendering contracts.
  • Code path: deliverOutboundPayloads builds the plugin handler, applies outbound.sanitizeText before normalization/chunk planning, then invokes the Mattermost message adapter and transport.
  • Regression: replaced the PR-history/seam-only test with an actual handler-to-send integration test covering internal trace removal and ordinary prose preservation.
  • Formatting: oxfmt --check extensions/mattermost/src/channel.ts extensions/mattermost/src/outbound-delivery.test.ts — pass.
  • Exact-head CI: https://github.com/openclaw/openclaw/actions/runs/28841899858 — pass (47 successful jobs, no failures).
  • Fresh Codex autoreview: clean; no accepted/actionable findings (confidence 0.94).
  • Repo-native prepare: OPENCLAW_TESTBOX=1 scripts/pr prepare-run 98693 — hosted exact-head gates passed.

No live Mattermost post was sent because this behavior is fully determined before network I/O; the integration test verifies the exact text received by the Mattermost transport mock without creating a user-visible message.

@steipete
steipete merged commit 1ef4544 into openclaw:main Jul 7, 2026
109 of 111 checks passed
@steipete

steipete commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 7, 2026
…openclaw#98693)

* fix(mattermost): strip internal tool-trace banners from outbound text

Co-authored-by: Cursor <[email protected]>

* test(mattermost): prove outbound sanitizer send path

---------

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
sheyanmin pushed a commit to sheyanmin/openclaw that referenced this pull request Jul 8, 2026
…openclaw#98693)

* fix(mattermost): strip internal tool-trace banners from outbound text

Co-authored-by: Cursor <[email protected]>

* test(mattermost): prove outbound sanitizer send path

---------

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
giodl73-repo pushed a commit to giodl73-repo/openclaw that referenced this pull request Jul 8, 2026
…openclaw#98693)

* fix(mattermost): strip internal tool-trace banners from outbound text

Co-authored-by: Cursor <[email protected]>

* test(mattermost): prove outbound sanitizer send path

---------

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
miorbnli added a commit to miorbnli/openclaw that referenced this pull request Jul 10, 2026
…text

The Nextcloud Talk outbound adapter had no sanitizeText hook, so internal
assistant tool-trace scaffolding (e.g. "⚠️ 🛠️ `exec (agent)` failed", raw
<tool_call>/<function_response> XML) leaked verbatim into delivered chat
messages. The same one-line sanitizeText hook was already shipped to 13 sibling
channels (mattermost openclaw#98693, feishu openclaw#98705, twitch openclaw#103109, signal openclaw#97360,
slack openclaw#97367, matrix openclaw#97372, irc openclaw#97214, telegram, googlechat openclaw#90684,
qqbot openclaw#90132, discord, whatsapp openclaw#71830, sms).

Add sanitizeText: ({ text }) => sanitizeAssistantVisibleText(text) to the
outbound base adapter, matching those precedents.

Co-Authored-By: Claude <[email protected]>
miorbnli added a commit to miorbnli/openclaw that referenced this pull request Jul 10, 2026
The Nostr outbound adapter had no sanitizeText hook, so internal assistant
tool-trace scaffolding (e.g. "⚠️ 🛠️ `exec (agent)` failed", raw
<tool_call>/<function_response> XML) leaked verbatim into delivered Nostr DMs.
The same one-line sanitizeText hook was already shipped to 13 sibling channels
(twitch openclaw#103109, mattermost openclaw#98693, feishu openclaw#98705, signal openclaw#97360, slack openclaw#97367,
matrix openclaw#97372, irc openclaw#97214, telegram, googlechat openclaw#90684, qqbot openclaw#90132, discord,
whatsapp openclaw#71830, sms).

Add sanitizeText to the NostrOutboundAdapter type and adapter, matching those
precedents.

Co-Authored-By: Claude <[email protected]>
miorbnli added a commit to miorbnli/openclaw that referenced this pull request Jul 10, 2026
The Zalo outbound adapter had no sanitizeText hook, so internal assistant
tool-trace scaffolding (e.g. "⚠️ 🛠️ `exec (agent)` failed", raw
<tool_call>/<function_response> XML) leaked verbatim into delivered Zalo
messages. The same one-line sanitizeText hook was already shipped to 13 sibling
channels (twitch openclaw#103109, mattermost openclaw#98693, feishu openclaw#98705, signal openclaw#97360,
slack openclaw#97367, matrix openclaw#97372, irc openclaw#97214, telegram, googlechat openclaw#90684,
qqbot openclaw#90132, discord, whatsapp openclaw#71830, sms).

Add sanitizeText: ({ text }) => sanitizeAssistantVisibleText(text) to the
outbound adapter, matching those precedents.

Co-Authored-By: Claude <[email protected]>
miorbnli added a commit to miorbnli/openclaw that referenced this pull request Jul 13, 2026
The Nostr outbound adapter had no sanitizeText hook, so internal assistant
tool-trace scaffolding (e.g. "⚠️ 🛠️ `exec (agent)` failed", raw
<tool_call>/<function_response> XML) leaked verbatim into delivered Nostr DMs.
The same one-line sanitizeText hook was already shipped to 13 sibling channels
(twitch openclaw#103109, mattermost openclaw#98693, feishu openclaw#98705, signal openclaw#97360, slack openclaw#97367,
matrix openclaw#97372, irc openclaw#97214, telegram, googlechat openclaw#90684, qqbot openclaw#90132, discord,
whatsapp openclaw#71830, sms).

Add sanitizeText to the NostrOutboundAdapter type and adapter, matching those
precedents.

Co-Authored-By: Claude <[email protected]>
miorbnli added a commit to miorbnli/openclaw that referenced this pull request Jul 13, 2026
The Zalo outbound adapter had no sanitizeText hook, so internal assistant
tool-trace scaffolding (e.g. "⚠️ 🛠️ `exec (agent)` failed", raw
<tool_call>/<function_response> XML) leaked verbatim into delivered Zalo
messages. The same one-line sanitizeText hook was already shipped to 13 sibling
channels (twitch openclaw#103109, mattermost openclaw#98693, feishu openclaw#98705, signal openclaw#97360,
slack openclaw#97367, matrix openclaw#97372, irc openclaw#97214, telegram, googlechat openclaw#90684,
qqbot openclaw#90132, discord, whatsapp openclaw#71830, sms).

Add sanitizeText: ({ text }) => sanitizeAssistantVisibleText(text) to the
outbound adapter, matching those precedents.

Co-Authored-By: Claude <[email protected]>
miorbnli added a commit to miorbnli/openclaw that referenced this pull request Jul 13, 2026
The Zalo outbound adapter had no sanitizeText hook, so internal assistant
tool-trace scaffolding (e.g. "⚠️ 🛠️ `exec (agent)` failed", raw
<tool_call>/<function_response> XML) leaked verbatim into delivered Zalo
messages. The same one-line sanitizeText hook was already shipped to 13 sibling
channels (twitch openclaw#103109, mattermost openclaw#98693, feishu openclaw#98705, signal openclaw#97360,
slack openclaw#97367, matrix openclaw#97372, irc openclaw#97214, telegram, googlechat openclaw#90684,
qqbot openclaw#90132, discord, whatsapp openclaw#71830, sms).

Add sanitizeText: ({ text }) => sanitizeAssistantVisibleText(text) to the
outbound adapter, matching those precedents.

Co-Authored-By: Claude <[email protected]>
miorbnli added a commit to miorbnli/openclaw that referenced this pull request Jul 13, 2026
The Nostr outbound adapter had no sanitizeText hook, so internal assistant
tool-trace scaffolding (e.g. "⚠️ 🛠️ `exec (agent)` failed", raw
<tool_call>/<function_response> XML) leaked verbatim into delivered Nostr DMs.
The same one-line sanitizeText hook was already shipped to 13 sibling channels
(twitch openclaw#103109, mattermost openclaw#98693, feishu openclaw#98705, signal openclaw#97360, slack openclaw#97367,
matrix openclaw#97372, irc openclaw#97214, telegram, googlechat openclaw#90684, qqbot openclaw#90132, discord,
whatsapp openclaw#71830, sms).

Add sanitizeText to the NostrOutboundAdapter type and adapter, matching those
precedents.

Co-Authored-By: Claude <[email protected]>
miorbnli added a commit to miorbnli/openclaw that referenced this pull request Jul 13, 2026
The Nostr outbound adapter had no sanitizeText hook, so internal assistant
tool-trace scaffolding (e.g. "⚠️ 🛠️ `exec (agent)` failed", raw
<tool_call>/<function_response> XML) leaked verbatim into delivered Nostr DMs.
The same one-line sanitizeText hook was already shipped to 13 sibling channels
(twitch openclaw#103109, mattermost openclaw#98693, feishu openclaw#98705, signal openclaw#97360, slack openclaw#97367,
matrix openclaw#97372, irc openclaw#97214, telegram, googlechat openclaw#90684, qqbot openclaw#90132, discord,
whatsapp openclaw#71830, sms).

Add sanitizeText to the NostrOutboundAdapter type and adapter, matching those
precedents.

Co-Authored-By: Claude <[email protected]>
miorbnli added a commit to miorbnli/openclaw that referenced this pull request Jul 13, 2026
The Zalo outbound adapter had no sanitizeText hook, so internal assistant
tool-trace scaffolding (e.g. "⚠️ 🛠️ `exec (agent)` failed", raw
<tool_call>/<function_response> XML) leaked verbatim into delivered Zalo
messages. The same one-line sanitizeText hook was already shipped to 13 sibling
channels (twitch openclaw#103109, mattermost openclaw#98693, feishu openclaw#98705, signal openclaw#97360,
slack openclaw#97367, matrix openclaw#97372, irc openclaw#97214, telegram, googlechat openclaw#90684,
qqbot openclaw#90132, discord, whatsapp openclaw#71830, sms).

Add sanitizeText: ({ text }) => sanitizeAssistantVisibleText(text) to the
outbound adapter, matching those precedents.

Co-Authored-By: Claude <[email protected]>
miorbnli added a commit to miorbnli/openclaw that referenced this pull request Jul 13, 2026
The Zalo outbound adapter had no sanitizeText hook, so internal assistant
tool-trace scaffolding (e.g. "⚠️ 🛠️ `exec (agent)` failed", raw
<tool_call>/<function_response> XML) leaked verbatim into delivered Zalo
messages. The same one-line sanitizeText hook was already shipped to 13 sibling
channels (twitch openclaw#103109, mattermost openclaw#98693, feishu openclaw#98705, signal openclaw#97360,
slack openclaw#97367, matrix openclaw#97372, irc openclaw#97214, telegram, googlechat openclaw#90684,
qqbot openclaw#90132, discord, whatsapp openclaw#71830, sms).

Add sanitizeText: ({ text }) => sanitizeAssistantVisibleText(text) to the
outbound adapter, matching those precedents.

Co-Authored-By: Claude <[email protected]>
wheakerd pushed a commit to wheakerd/clawdbot that referenced this pull request Jul 15, 2026
…openclaw#98693)

* fix(mattermost): strip internal tool-trace banners from outbound text

Co-authored-by: Cursor <[email protected]>

* test(mattermost): prove outbound sanitizer send path

---------

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit 1ef4544)
miorbnli added a commit to miorbnli/openclaw that referenced this pull request Jul 19, 2026
The Nostr outbound adapter had no sanitizeText hook, so internal assistant
tool-trace scaffolding (e.g. "⚠️ 🛠️ `exec (agent)` failed", raw
<tool_call>/<function_response> XML) leaked verbatim into delivered Nostr DMs.
The same one-line sanitizeText hook was already shipped to 13 sibling channels
(twitch openclaw#103109, mattermost openclaw#98693, feishu openclaw#98705, signal openclaw#97360, slack openclaw#97367,
matrix openclaw#97372, irc openclaw#97214, telegram, googlechat openclaw#90684, qqbot openclaw#90132, discord,
whatsapp openclaw#71830, sms).

Add sanitizeText to the NostrOutboundAdapter type and adapter, matching those
precedents.

Co-Authored-By: Claude <[email protected]>
miorbnli added a commit to miorbnli/openclaw that referenced this pull request Jul 19, 2026
The Nostr outbound adapter had no sanitizeText hook, so internal assistant
tool-trace scaffolding (e.g. "⚠️ 🛠️ `exec (agent)` failed", raw
<tool_call>/<function_response> XML) leaked verbatim into delivered Nostr DMs.
The same one-line sanitizeText hook was already shipped to 13 sibling channels
(twitch openclaw#103109, mattermost openclaw#98693, feishu openclaw#98705, signal openclaw#97360, slack openclaw#97367,
matrix openclaw#97372, irc openclaw#97214, telegram, googlechat openclaw#90684, qqbot openclaw#90132, discord,
whatsapp openclaw#71830, sms).

Add sanitizeText to the NostrOutboundAdapter type and adapter, matching those
precedents.

Co-Authored-By: Claude <[email protected]>
miorbnli added a commit to miorbnli/openclaw that referenced this pull request Jul 24, 2026
The Nostr outbound adapter had no sanitizeText hook, so internal assistant
tool-trace scaffolding (e.g. "⚠️ 🛠️ `exec (agent)` failed", raw
<tool_call>/<function_response> XML) leaked verbatim into delivered Nostr DMs.
The same one-line sanitizeText hook was already shipped to 13 sibling channels
(twitch openclaw#103109, mattermost openclaw#98693, feishu openclaw#98705, signal openclaw#97360, slack openclaw#97367,
matrix openclaw#97372, irc openclaw#97214, telegram, googlechat openclaw#90684, qqbot openclaw#90132, discord,
whatsapp openclaw#71830, sms).

Add sanitizeText to the NostrOutboundAdapter type and adapter, matching those
precedents.

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: mattermost Channel integration: mattermost merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants