Skip to content

fix(slack): suppress reasoning payloads in non-streaming delivery paths#84322

Merged
joshavant merged 1 commit into
openclaw:mainfrom
ffluk3:fix/slack-suppress-reasoning-payloads
May 21, 2026
Merged

fix(slack): suppress reasoning payloads in non-streaming delivery paths#84322
joshavant merged 1 commit into
openclaw:mainfrom
ffluk3:fix/slack-suppress-reasoning-payloads

Conversation

@ffluk3

@ffluk3 ffluk3 commented May 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #84319.

Slack could surface model reasoning/thinking payloads as visible messages outside the already-guarded native streaming path. This updates Slack reply delivery to suppress isReasoning payloads before queue/delivery accounting, adds defense-in-depth guards in direct Slack reply helpers, and fixes the shared reply transform contract so a channel transform returning null actually cancels delivery.

Changes

  • Suppresses reasoning payloads in the Slack monitor reply pipeline before dispatch accounting.
  • Applies the same transform to Slack slash-command reply pipelines.
  • Keeps direct deliverReplies() and deliverSlackSlashReplies() from sending reasoning payloads.
  • Honors transformReplyPayload(...): null in shared reply normalization instead of falling back to the original payload.
  • Adds regression coverage for non-streaming delivery, streaming fallback, reasoning-only turns, first-reply delivery state, slash replies, direct replies, and pre-queue cancellation.

Verification

  • node scripts/run-vitest.mjs src/auto-reply/reply/before-deliver.test.ts extensions/slack/src/monitor/message-handler/dispatch.preview-fallback.test.ts extensions/slack/src/monitor/replies.test.ts extensions/slack/src/monitor/slash.test.ts
  • codex review --uncommitted
  • git diff --check
  • AWS Crabbox live Slack proof: provider=aws, leaseId=cbx_15f21da2e5c2, run=run_f413099ecbfd

Observed result after fix: focused tests passed, autoreview returned no accepted/actionable findings, and the live Slack proof observed the visible final marker while the reasoning marker was absent.

Real behavior proof

Behavior addressed: Reasoning/thinking payloads marked with isReasoning could leak into Slack as visible messages through non-streaming, fallback, slash-command, or direct reply delivery paths.
Real environment tested: AWS Crabbox direct provider running this patch against a real Slack workspace/channel using a Convex-leased kind=slack credential.
Exact steps or command run after this patch: node scripts/crabbox-wrapper.mjs run -provider aws -env-from-profile /private/tmp/convex_pool.env -allow-env OPENCLAW_QA_CONVEX_SITE_URL,OPENCLAW_QA_CONVEX_SECRET_CI -idle-timeout 90m -ttl 180m -timing-json -script-stdin, with the remote script leasing the Slack credential, calling the patched deliverReplies() path with one reasoning marker and one final marker, polling Slack history, and deleting proof messages.
Evidence after fix: Crabbox run run_f413099ecbfd on AWS lease cbx_15f21da2e5c2 printed credential_source=convex, credential_kind=slack, final_marker_observed=true, reasoning_marker_observed=false, and messages_examined=2.
Observed result after fix: The visible final Slack message was delivered; the reasoning payload was not delivered to Slack; proof messages were cleaned up after observation.
What was not tested: A full live model/provider turn was not rerun after the patch; dispatcher accounting and slash-command behavior are covered by focused regression tests, and the live proof exercises the real Slack delivery API path.

@clawsweeper

clawsweeper Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Workflow note: Future ClawSweeper reviews update this same comment in place.

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.

Summary
The PR adds isReasoning return/skip guards in Slack dispatch and reply helpers, plus regression tests for non-streaming, fallback, helper, and slash-command delivery.

Reproducibility: yes. from source inspection: current main suppresses isReasoning in Slack native streaming but not in the non-streaming dispatch, shared reply, or slash-command helper paths. I did not run a live Slack repro in this read-only review.

PR rating
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🦞 diamond lobster
Summary: The patch is focused and well covered, and the updated PR body supplies sufficient live Slack proof, though not an attached screenshot or recording.

Rank-up moves:

  • none
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.

Real behavior proof
Sufficient (live_output): The PR body now includes copied before/after live Slack output from a private Slack workspace and a local OpenClaw dev build showing non-streaming reasoning text suppressed after the patch.

Mantis proof suggestion
A maintainer-captured Slack smoke would add useful artifact proof for this visible message-delivery behavior, especially for the slash/non-streaming transport boundary. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

slack desktop smoke: verify that a non-streaming Slack turn with reasoning/thinking payloads posts only final user-visible content and no reasoning text.

Next step before merge
No repair lane is needed; this PR has no blocking findings and should proceed through maintainer review and normal CI.

Security
Cleared: The diff only adds Slack payload suppression guards and tests, with no dependency, workflow, secret, package, or supply-chain surface changes.

Review details

Best possible solution:

Land the focused Slack plugin delivery-boundary fix after normal CI, keeping reasoning suppression local to Slack paths that do not have a dedicated reasoning display lane.

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

Yes from source inspection: current main suppresses isReasoning in Slack native streaming but not in the non-streaming dispatch, shared reply, or slash-command helper paths. I did not run a live Slack repro in this read-only review.

Is this the best way to solve the issue?

Yes, the PR applies the same delivery-boundary suppression pattern already used by native streaming and generic routing, without changing core contracts or adding config.

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body now includes copied before/after live Slack output from a private Slack workspace and a local OpenClaw dev build showing non-streaming reasoning text suppressed after the patch.
  • add rating: 🐚 platinum hermit: Current PR rating is 🐚 platinum hermit because proof is 🐚 platinum hermit, patch quality is 🦞 diamond lobster, and The patch is focused and well covered, and the updated PR body supplies sufficient live Slack proof, though not an attached screenshot or recording.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body now includes copied before/after live Slack output from a private Slack workspace and a local OpenClaw dev build showing non-streaming reasoning text suppressed after the patch.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P1: This fixes an active Slack channel workflow where model reasoning text can be posted visibly to users through non-streaming delivery paths.
  • rating: 🐚 platinum hermit: Current PR rating is 🐚 platinum hermit because proof is 🐚 platinum hermit, patch quality is 🦞 diamond lobster, and The patch is focused and well covered, and the updated PR body supplies sufficient live Slack proof, though not an attached screenshot or recording.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body now includes copied before/after live Slack output from a private Slack workspace and a local OpenClaw dev build showing non-streaming reasoning text suppressed after the patch.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body now includes copied before/after live Slack output from a private Slack workspace and a local OpenClaw dev build showing non-streaming reasoning text suppressed after the patch.

What I checked:

Likely related people:

  • Galin Iliev: Current-main blame for the Slack dispatch and reply helper regions points to the commit that populated these files in the checked-out main history. (role: introduced current behavior snapshot; confidence: medium; commits: 04eac15f43d5; files: extensions/slack/src/monitor/message-handler/dispatch.ts, extensions/slack/src/monitor/replies.ts)
  • Peter Steinberger: Recent history on the same Slack dispatch path includes thread-starter and delivery-context fixes, and broader reply-payload refactors touch the same routing contract. (role: recent adjacent Slack contributor; confidence: medium; commits: 6b525023d4d2, 62edfdffbdd0; files: extensions/slack/src/monitor/message-handler/dispatch.ts, src/plugin-sdk/reply-payload.ts)
  • Vincent Koc: The shared reply payload suppression helper used as the contract anchor was introduced in a reply payload helper split by this contributor. (role: reply payload contract contributor; confidence: medium; commits: 125e778fe618; files: src/auto-reply/reply/reply-payloads-base.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against eea71708ac53.

@openclaw-barnacle openclaw-barnacle Bot added channel: slack Channel integration: slack size: S triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 19, 2026
@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. P1 High-priority user-facing bug, regression, or broken workflow. labels May 19, 2026
@openclaw-barnacle openclaw-barnacle Bot added triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. and removed triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels May 20, 2026
@ffluk3 ffluk3 force-pushed the fix/slack-suppress-reasoning-payloads branch from eba347a to 48fa140 Compare May 20, 2026 00:11
@openclaw-barnacle openclaw-barnacle Bot added triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 20, 2026
@ffluk3 ffluk3 force-pushed the fix/slack-suppress-reasoning-payloads branch from 48fa140 to 0ca0b14 Compare May 20, 2026 00:18
@ffluk3

ffluk3 commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

Note for maintainer review: I am unable to display screenshots that prove the slack integration works internal to my current environment.

@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. 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 May 20, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

✨ Hatched: 🥚 common Gilded Review Wisp

       _..------.._          
    .-'  .-.  .-.  '-.       
   /    ( * )( * )    \      
  |        .--.        |     
  |   <\   ====   />   |     
   \    '.______.'    /      
    '-._   ____   _.-'       
        `-.____.-'           
       __/|_||_|\__          
      /__.'    '.__\         
       .-----------.         
      '-------------'        

Rarity: 🥚 common.
Trait: hums during re-review.
Image traits: location workflow harbor; accessory commit compass; palette sunrise gold and clean white; mood calm; pose curling around a status light; shell matte ceramic shell; lighting cool dashboard glow; background subtle branch markers.
How to hatch it: once this PR reaches status: 👀 ready for maintainer look or status: 🚀 automerge armed, the PR author or a maintainer can comment @clawsweeper hatch to turn this ASCII egg into its generated creature image.
Share on X: post this hatch
Copy: My PR egg hatched a 🥚 common Gilded Review Wisp in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchable usually means sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@joshavant joshavant force-pushed the fix/slack-suppress-reasoning-payloads branch from 0ca0b14 to f3694bc Compare May 21, 2026 07:33
@openclaw-barnacle openclaw-barnacle Bot added size: M triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. and removed size: S triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. proof: sufficient ClawSweeper judged the real behavior proof convincing. labels May 21, 2026
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
@joshavant joshavant force-pushed the fix/slack-suppress-reasoning-payloads branch from f3694bc to d5c36d7 Compare May 21, 2026 07:35
@joshavant joshavant merged commit b05c615 into openclaw:main May 21, 2026
97 of 98 checks passed
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 24, 2026
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
galiniliev pushed a commit to galiniliev/openclaw that referenced this pull request May 25, 2026
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
SYU8384 pushed a commit to SYU8384/openclaw that referenced this pull request Jun 3, 2026
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: slack Channel integration: slack P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Slack: reasoning/thinking payloads from Claude models leak through non-streaming delivery paths

2 participants