fix(slack): suppress reasoning payloads in non-streaming delivery paths#84322
Conversation
|
Codex review: needs maintainer review before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. from source inspection: current main suppresses PR rating Rank-up moves:
What the crustacean ranks mean
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 Mantis proof suggestion Next step before merge Security Review detailsBest 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 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:
Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against eea71708ac53. |
eba347a to
48fa140
Compare
48fa140 to
0ca0b14
Compare
|
Note for maintainer review: I am unable to display screenshots that prove the slack integration works internal to my current environment. |
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Gilded Review Wisp Rarity: 🥚 common. What is this egg doing here?
|
0ca0b14 to
f3694bc
Compare
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
f3694bc to
d5c36d7
Compare
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
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
isReasoningpayloads 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 returningnullactually cancels delivery.Changes
deliverReplies()anddeliverSlackSlashReplies()from sending reasoning payloads.transformReplyPayload(...): nullin shared reply normalization instead of falling back to the original payload.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.tscodex review --uncommittedgit diff --checkprovider=aws,leaseId=cbx_15f21da2e5c2,run=run_f413099ecbfdObserved 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
isReasoningcould 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=slackcredential.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 patcheddeliverReplies()path with one reasoning marker and one final marker, polling Slack history, and deleting proof messages.Evidence after fix: Crabbox run
run_f413099ecbfdon AWS leasecbx_15f21da2e5c2printedcredential_source=convex,credential_kind=slack,final_marker_observed=true,reasoning_marker_observed=false, andmessages_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.