Skip to content

fix(clickclack): strip internal tool-trace banners from outbound text - #103142

Merged
steipete merged 1 commit into
openclaw:mainfrom
masatohoshino:clickclack-outbound-tool-trace-sanitize
Jul 11, 2026
Merged

steipete merged 1 commit into
openclaw:mainfrom
masatohoshino:clickclack-outbound-tool-trace-sanitize

Conversation

@masatohoshino

@masatohoshino masatohoshino commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Related: #90684

What Problem This Solves

ClickClack's custom delivery path bypasses core outbound sanitization, so assistant tool-call XML and compact tool-failure banners could reach channel, thread, and direct-message requests unchanged.

Why This Change Was Made

sendClickClackText is the private sender boundary shared by every ClickClack delivery path. Sanitizing there covers inbound replies, model-reply mode, the channel adapter, and proactive outbound without broadening behavior in unrelated channels.

If sanitization removes the entire reply, the sender suppresses the transport request. Modern channel delivery already permits a missing message ID; the legacy attached-results bridge alone maps that result to its required empty-string sentinel. The unrelated missing-ID throw was removed.

User Impact

ClickClack users no longer see internal tool/XML traces. Ordinary prose is preserved, and scaffold-only replies do not create rejected empty requests.

Evidence

  • Existing outbound suite now covers contaminated channel quote-replies, explicit thread replies, and direct messages.
  • Scaffold-only coverage asserts that no ClickClack transport method is called.
  • Existing plain-text cases preserve ordinary prose.
  • Exact-head CI run 29133146827: 61 green checks, no failures.
  • Exact-commit Codex autoreview: no accepted or actionable findings; patch correct, confidence 0.84.
  • Native review artifacts: READY, zero findings; hosted prepare-run passed.

No live ClickClack tenant was used; the focused suite asserts the exact payload at the private sender-to-client boundary changed here.

AI-assisted.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 10, 2026
@clawsweeper

clawsweeper Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 10, 2026, 8:50 PM ET / July 11, 2026, 00:50 UTC.

Summary
The PR sanitizes all text inside sendClickClackText, suppresses transport when sanitization removes the full payload, and changes channel and legacy result handling to allow a missing message ID.

PR surface: Source +10, Tests +15. Total +25 across 3 files.

Reproducibility: yes. Current source shows both ClickClack-generated assistant reply paths bypass the standard outbound sanitizer, and focused tests model representative leaked banners at the sender-to-client boundary.

Review metrics: 2 noteworthy metrics.

  • Shared sender reach: 4 production call sites. The changed helper serves two generic channel delivery surfaces and two generated inbound reply paths, so sender-wide filtering exceeds the reported assistant-only failure.
  • Transport result contract: 1 concrete result changed to optional ID. The broader return change forces receipt and legacy bridge adaptations that are unnecessary when sanitization remains at assistant-owned boundaries.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #90684
Summary: This PR is the ClickClack-specific candidate slice of the broader open non-Discord assistant-text sanitization audit.

Members:

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

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🦐 gold shrimp
Result: blocked until real behavior proof from a real setup is added.

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

Rank-up moves:

  • Adopt the adapter-plus-custom-inbound sanitization pattern while preserving literal low-level sends.
  • Post redacted real ClickClack output or transport logs showing mixed contaminated text is cleaned and scaffold-only output sends nothing.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR explicitly relies on mocked sender/client tests and CI without a real ClickClack tenant run; add a redacted live transcript or transport log, then update the PR body to trigger review or ask a maintainer to comment @clawsweeper re-review.

Risk before merge

  • [P1] Merging this head can silently rewrite or suppress caller-authored ClickClack messages containing tool XML, failure-banner examples, or similar literal content.
  • [P1] The optional message-ID and receipt changes broaden the transport contract solely to accommodate sanitization at the wrong ownership boundary.
  • [P1] No real ClickClack tenant output or transport log currently proves mixed contaminated text is cleaned and scaffold-only output produces no request.

Maintainer options:

  1. Match the landed sibling pattern (recommended)
    Preserve literal low-level sends while sanitizing standard outbound and the two custom generated inbound reply paths at their ownership boundaries.
  2. Intentionally redefine all ClickClack sends
    Keep transport-wide filtering only if owners explicitly decide every supported caller may have internal-looking literal text rewritten or suppressed.

Next step before merge

  • [P1] The assigned reviewer or contributor should apply the clear boundary correction and supply real ClickClack proof; missing external-setup proof keeps this human-only rather than a ClawSweeper repair dispatch.

Security
Cleared: The plugin-only TypeScript and test diff introduces no concrete dependency, workflow, permission, secret-handling, package-resolution, or supply-chain concern.

Review findings

  • [P1] Keep generic ClickClack sends literal — extensions/clickclack/src/outbound.ts:27-32
Review details

Best possible solution:

Match the landed sibling pattern: use outbound.base.sanitizeText for standard delivery, sanitize the two custom generated inbound paths explicitly, suppress only fully stripped assistant replies, and preserve the low-level sender's literal payload and concrete result contract.

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

Yes. Current source shows both ClickClack-generated assistant reply paths bypass the standard outbound sanitizer, and focused tests model representative leaked banners at the sender-to-client boundary.

Is this the best way to solve the issue?

No. A dedicated outbound sanitization hook and a maintainer-landed sibling implementation provide a narrower solution that fixes generated replies without redefining literal transport behavior.

Full review comments:

  • [P1] Keep generic ClickClack sends literal — extensions/clickclack/src/outbound.ts:27-32
    Move this sanitization out of sendClickClackText. The helper also backs generic outbound and legacy attached-results sends, so caller-authored code or text matching tool-trace patterns can be changed or dropped. The merged Nextcloud Talk slice for the same canonical issue sanitizes standard outbound and custom inbound replies separately while explicitly preserving low-level literal sends; ClickClack should follow that shape.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add merge-risk: 🚨 message-delivery: The shared-sender implementation can rewrite or fully suppress outbound messages outside the contaminated assistant-reply cases.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR explicitly relies on mocked sender/client tests and CI without a real ClickClack tenant run; add a redacted live transcript or transport log, then update the PR body to trigger review or ask a maintainer to comment @clawsweeper re-review.

Label justifications:

  • P2: The PR addresses a real user-visible ClickClack content bug with limited channel scope and a clear bounded repair.
  • merge-risk: 🚨 message-delivery: The shared-sender implementation can rewrite or fully suppress outbound messages outside the contaminated assistant-reply cases.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR explicitly relies on mocked sender/client tests and CI without a real ClickClack tenant run; add a redacted live transcript or transport log, then update the PR body to trigger review or ask a maintainer to comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +10, Tests +15. Total +25 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 25 15 +10
Tests 1 26 11 +15
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 51 26 +25

What I checked:

  • Current-main bug path: Both the direct model completion and buffered inbound reply paths pass generated assistant text directly to the literal ClickClack sender without sanitizeAssistantVisibleText. (extensions/clickclack/src/inbound.ts:106, e07ad4b05bcc)
  • Overbroad changed boundary: The PR unconditionally sanitizes inside the shared low-level sender, allowing any caller-authored payload to be rewritten or fully suppressed before target routing. (extensions/clickclack/src/outbound.ts:27, 71cf8fe64338)
  • Supported outbound seam: The channel outbound contract provides a dedicated sanitizeText hook, and the central delivery pipeline applies it before removing fully empty visible payloads. (src/channels/plugins/outbound.types.ts:165, e07ad4b05bcc)
  • Accepted sibling implementation: The merged Nextcloud Talk slice for the same canonical issue uses outbound.base.sanitizeText plus explicit custom-inbound sanitization, while regression coverage preserves caller-authored low-level sends literally. (extensions/nextcloud-talk/src/channel.ts:205, 8a93d288e2f5)
  • Feature provenance: The current ClickClack sender, its concrete { to, messageId } result, and its production callers were introduced together in the initial ClickClack implementation. (extensions/clickclack/src/outbound.ts:15, 54cc90b1b1a8)
  • Re-review continuity: The three changed files are identical between the previously reviewed head that received the low-level-send P1 finding and the current head, so that blocker remains unresolved rather than being a late discovery. (extensions/clickclack/src/outbound.ts:27, 71cf8fe64338)

Likely related people:

  • vincentkoc: Git history attributes the initial ClickClack plugin, literal sender, inbound callers, and channel wiring to this author. (role: introduced current behavior; confidence: high; commits: 54cc90b1b1a8; files: extensions/clickclack/src/outbound.ts, extensions/clickclack/src/inbound.ts, extensions/clickclack/src/channel.ts)
  • steipete: The live PR is assigned to this person, who committed the current head and documented the accepted low-level-literal behavior for the matching Nextcloud Talk slice. (role: assigned reviewer and recent branch committer; confidence: high; commits: 71cf8fe64338; files: extensions/clickclack/src/outbound.ts, extensions/clickclack/src/channel.ts, extensions/clickclack/src/outbound.test.ts)
  • Pick-cat: Authored the merged Nextcloud Talk fix for the same canonical issue, including adapter sanitization, custom-inbound handling, and literal-send negative controls. (role: adjacent implementation owner; confidence: high; commits: 8a93d288e2f5; files: extensions/nextcloud-talk/src/channel.ts, extensions/nextcloud-talk/src/inbound.ts, extensions/nextcloud-talk/src/outbound-tool-trace-sanitize.test.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.
Review history (4 earlier review cycles)
  • reviewed 2026-07-10T07:13:21.090Z sha 7f4cb6ed0598e316bfaea781f1d51c5dd97236ea :: needs real behavior proof before merge. :: [P1] Sanitize the actual inbound reply path
  • reviewed 2026-07-10T15:02:45.193Z sha f6d7f09e82e9d317536834ef51ada7c6ac619cc2 :: needs changes before merge. :: [P2] Handle replies emptied by sanitization
  • reviewed 2026-07-10T15:50:02.578Z sha c4db4f87f64e301462d18b8aec58d6d4e3fa6678 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-11T00:35:13.720Z sha 77249dc80a1aebe9d3416eca74d74d3e853de458 :: needs changes before merge. :: [P1] Keep low-level ClickClack sends literal

@masatohoshino
masatohoshino force-pushed the clickclack-outbound-tool-trace-sanitize branch from 7f4cb6e to f6d7f09 Compare July 10, 2026 14:44
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 10, 2026
@masatohoshino
masatohoshino force-pushed the clickclack-outbound-tool-trace-sanitize branch from f6d7f09 to c4db4f8 Compare July 10, 2026 15:27
@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 10, 2026
@steipete steipete self-assigned this Jul 10, 2026
@steipete
steipete force-pushed the clickclack-outbound-tool-trace-sanitize branch 2 times, most recently from 1037c15 to 0e4da08 Compare July 11, 2026 00:14
@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 11, 2026
@steipete
steipete force-pushed the clickclack-outbound-tool-trace-sanitize branch from 0e4da08 to 77249dc Compare July 11, 2026 00:25
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 11, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. label Jul 11, 2026
@steipete
steipete force-pushed the clickclack-outbound-tool-trace-sanitize branch from 77249dc to a7ba048 Compare July 11, 2026 00:40
@steipete
steipete force-pushed the clickclack-outbound-tool-trace-sanitize branch from a7ba048 to 71cf8fe Compare July 11, 2026 00:41
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 11, 2026
@steipete

Copy link
Copy Markdown
Contributor

Land-ready proof for 71cf8fe64338d2e1f5c500c40e03ecb745bf5621.

What changed:

  • ClickClack sanitizes assistant-visible text at its private sender boundary, covering channel, thread, DM, inbound, and proactive paths.
  • Scaffold-only text suppresses transport instead of sending an empty request.
  • Modern delivery preserves its optional message ID; only the legacy attached-results bridge uses the required empty-string sentinel.

Validation:

Known gap: no live ClickClack tenant was used. The suite asserts the exact payload and no-send behavior at the private sender-to-client boundary changed here.

@steipete
steipete merged commit 2a69149 into openclaw:main Jul 11, 2026
122 of 132 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

vincentkoc added a commit that referenced this pull request Jul 11, 2026
* origin/main:
  fix(tui): preserve UTF-16 pairs in long tokens (#104024)
  fix(release): raise Telegram attestor buffer (#104025)
  fix(slack): apply sender policy to group DMs (#104007)
  feat(ui): add a background tasks pane to chat panes (#104010)
  docs(changelog): credit landed fixes
  fix(installer): clean temporary files on failure (#103725)
  fix(clickclack): sanitize outbound assistant text (#103142)
  fix(sms): normalize Twilio RCS webhook senders (#102373)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 11, 2026
RomneyDa pushed a commit that referenced this pull request Aug 30, 2026
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
* origin/main:
  fix(tui): preserve UTF-16 pairs in long tokens (openclaw#104024)
  fix(release): raise Telegram attestor buffer (openclaw#104025)
  fix(slack): apply sender policy to group DMs (openclaw#104007)
  feat(ui): add a background tasks pane to chat panes (openclaw#104010)
  docs(changelog): credit landed fixes
  fix(installer): clean temporary files on failure (openclaw#103725)
  fix(clickclack): sanitize outbound assistant text (openclaw#103142)
  fix(sms): normalize Twilio RCS webhook senders (openclaw#102373)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants