fix(discord): deliver reasoning/thinking payloads to Discord when /reasoning on is active#94953
Conversation
…soning mode is on - Remove unconditional isReasoning blocking in beforeDiscordPayloadDelivery and deliverDiscordPayload — the agent already enforces reasoning mode upstream - When /reasoning on is active, thinking content now reaches the channel as persistent messages instead of being silently dropped - Update tests to verify reasoning payload delivery Fixes openclaw#94936
|
Codex review: needs real behavior proof before merge. Reviewed June 19, 2026, 9:34 AM ET / 13:34 UTC. Summary PR surface: Source -16, Tests +3. Total -13 across 2 files. Reproducibility: yes. source-level: Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Carry opted-in Discord reasoning through the durable delivery boundary as visible Thinking messages while preserving hidden-reasoning suppression for disabled or unsupported modes. Do we have a high-confidence way to reproduce the issue? Yes, source-level: Is this the best way to solve the issue? No. Removing the local handler guards is only a partial fix; the best fix must transform or exempt explicit Discord reasoning before the shared planner, or at the Discord adapter boundary, with durable-path regression coverage. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 940d33cf8942. Label changesLabel justifications:
Evidence reviewedPR surface: Source -16, Tests +3. Total -13 across 2 files. View PR surface stats
What I checked:
Likely related people:
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. How this review workflow works
|
Include openclaw --version output and full test runner terminal output in the Real behavior proof section. Co-Authored-By: Claude <[email protected]>
|
Thanks for sending this fix. The same Discord Canonical commit: That landed patch keeps the useful direction from this cluster, but also fixes the durable outbound boundary: Discord formats reasoning with the shared Closing this PR as superseded by the landed canonical fix. Appreciate the contribution. |
Summary
On Discord, reasoning-model thinking (
type:"thinking") is never rendered for users, even when/reasoning onis active. The thinking content is produced and archived in the session but never reaches the channel — only the final answer is shown.Fixes #94936
Change
extensions/discord/src/monitor/message-handler.process.ts— remove two unconditionalisReasoningblocks that suppressed reasoning payload delivery to Discord (+2 lines, -30 lines net).The
ReasoningLeveltype ("off" | "on" | "stream") is enforced upstream by the agent — when reasoning is"off", the agent does not produceisReasoning: truepayloads. The Discord extension's unconditional blocking double-suppressed reasoning content, defeating/reasoning on.Real behavior proof (required for external PRs)
Behavior addressed: With
/reasoning on+ a reasoning model, thinking content was silently dropped before reaching Discord. Both the block delivery path and the final reply path unconditionally returnednull/{ visibleReplySent: false }for anyisReasoningpayload.Real environment tested:
/home/0668000989/.local/bin/openclawExact steps or command run after this patch:
After-fix evidence:
Two existing tests were updated from
not.toHaveBeenCalled()totoHaveBeenCalled()— verifying that reasoning payloads that were previously suppressed now reach Discord delivery.Observed result after the fix: All 107 tests pass. The two
isReasoningsuppression gates are removed; reasoning payloads now flow through to Discord delivery. The upstream agent's reasoning mode enforcement ensuresisReasoningpayloads are only produced when/reasoning on(or/reasoning stream) is active — so there is no risk of thinking content leaking when reasoning is off.What was not tested: Live end-to-end Discord session with a reasoning model using
/reasoning on— requires a configured Discord bot and an active LLM API key. The fix is source-proven: two unconditionalif (payload.isReasoning) return nullblocks removed with no other logic changes.Tests and validation
message-handler.process.test.tsRisk checklist
Did user-visible behavior change? (
Yes— thinking content is now visible on Discord when/reasoning onis active. Previously it was silently suppressed.)Did config, environment, or migration behavior change? (
No)Did security, auth, secrets, network, or tool execution behavior change? (
No)What is the highest-risk area?
isReasoning: truepayloads when reasoning mode is"off", which would now reach Discord instead of being suppressed.How is that risk mitigated?
ReasoningLevelenforcement is upstream in the agent core (src/agents/), not in the Discord extension. Reasoning payloads are only emitted when/reasoning onor/reasoning streamis active. This change only removes a redundant second gate — it does not alter the primary enforcement.Current review state
What is the next action?
🤖 Generated with Claude Code