fix(discord): apply tool status emojis immediately to avoid override by thinking reactions#93488
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 16, 2026, 12:49 AM ET / 04:49 UTC. Summary PR surface: Source +4, Tests +1. Total +5 across 2 files. Reproducibility: yes. at source level: current main shows the controller debounce can drop intermediate tool emojis, and the Discord default path can still filter Review metrics: 2 noteworthy metrics.
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: Land one canonical narrow fix that forwards Discord status-reaction lifecycle updates through the dispatch and follow-up gates without re-enabling verbose text progress, then prove it in real Discord; keep the immediate Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main shows the controller debounce can drop intermediate tool emojis, and the Discord default path can still filter Is this the best way to solve the issue? No. A controller-only debounce change is not the best complete fix for the linked Discord bug; the maintainable fix must also decouple lifecycle status reactions from visible tool-summary callback gates and then prove the transport behavior. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 88c9e4d644e1. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +4, Tests +1. Total +5 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
|
…by thinking reactions Tool emoji reactions (🛠️, 🌐, 🔎, etc.) during Discord tool/skill execution were not appearing because setTool() used a 700ms debounce shared with setThinking(). Rapid onReasoningStream calls from overlapping reasoning would repeatedly overwrite the pending tool emoji with 🧠, so the tool emoji never reached Discord. Fix by making setTool() apply emojis immediately (skip debounce). Tool transitions are user-facing state changes that should be visible without delay, and the terminal done/error transitions already flush any pending state. Fixes openclaw#92715.
d8d71c8 to
11bf896
Compare
|
Land-ready maintainer repair pushed to the contributor branch. Review repair moved the fix to the shared dispatch/follow-up boundary: Discord and Slack explicitly opt into channel-owned tool lifecycle status while verbose tool text remains hidden. Slack tool-only source policy now also permits the opted-in status callback; other item/command progress stays suppressed. Verification:
|
…by thinking reactions (openclaw#93488) * fix(discord): apply tool status emojis immediately to avoid override by thinking reactions Tool emoji reactions (🛠️, 🌐, 🔎, etc.) during Discord tool/skill execution were not appearing because setTool() used a 700ms debounce shared with setThinking(). Rapid onReasoningStream calls from overlapping reasoning would repeatedly overwrite the pending tool emoji with 🧠, so the tool emoji never reached Discord. Fix by making setTool() apply emojis immediately (skip debounce). Tool transitions are user-facing state changes that should be visible without delay, and the terminal done/error transitions already flush any pending state. Fixes openclaw#92715. * fix(discord): forward quiet tool lifecycle status * fix(slack): preserve tool status reactions * test(channels): type quiet tool lifecycle options --------- Co-authored-by: Vincent Koc <[email protected]>
…by thinking reactions (openclaw#93488) * fix(discord): apply tool status emojis immediately to avoid override by thinking reactions Tool emoji reactions (🛠️, 🌐, 🔎, etc.) during Discord tool/skill execution were not appearing because setTool() used a 700ms debounce shared with setThinking(). Rapid onReasoningStream calls from overlapping reasoning would repeatedly overwrite the pending tool emoji with 🧠, so the tool emoji never reached Discord. Fix by making setTool() apply emojis immediately (skip debounce). Tool transitions are user-facing state changes that should be visible without delay, and the terminal done/error transitions already flush any pending state. Fixes openclaw#92715. * fix(discord): forward quiet tool lifecycle status * fix(slack): preserve tool status reactions * test(channels): type quiet tool lifecycle options --------- Co-authored-by: Vincent Koc <[email protected]>
Summary
setTool()used a debounced (700ms) emoji schedule shared withsetThinking(), so rapidonReasoningStreamcallbacks would repeatedly overwrite the pending tool emoji with 🧠 before it could be appliedFixes #92715
Linked context
onToolStart→statusReactions.setTool()andonReasoningStream→statusReactions.setThinking()(message-handler.process.ts:1013-1024)setTool()andsetThinking()callsscheduleEmoji(), so the last call (typicallysetThinking()) would winReal behavior proof
Behavior addressed: Tool status reaction emojis now appear immediately on Discord messages instead of being silently dropped
Real setup tested:
src/channels/status-reactions.ts— the controller is platform-agnostic; the fix applies to all channels usingcreateStatusReactionControllerExact steps or command run after fix:
After-fix evidence:
The key behavioral test
"should apply tool emojis immediately (not debounced)"validates:Observed result after the fix: All 43 tests pass. The tool emoji sequence test now confirms that each distinct tool emoji is applied immediately to Discord, not debounced away by interleaved
setThinking()calls.What was not tested: End-to-end test with a live Discord bot token (requires credentials). The controller behavior is fully covered by unit tests. The Discord message handler integration (message-handler.process.ts) has 104 additional tests that continue to pass.
Proof limitations or environment constraints: The emoji reaction behavior is inherently a UI concern that requires Discord API credentials to demonstrate end-to-end. The unit tests validate the controller's scheduling behavior at the call level, which is the correct abstraction boundary for this fix.
Tests and validation
pnpm test -- --run src/channels/status-reactions.test.ts— 43/43 passedpnpm test -- --run extensions/discord/src/monitor/message-handler.process.test.ts— 104/104 passed"should only fire last state when rapidly changing"was renamed/updated to"should apply tool emojis immediately (not debounced)"and now asserts the corrected behavior: tool emojis are applied immediately rather than debouncedRisk checklist
Did user-visible behavior change? (
Yes)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?
setTool()change from debounced to immediate increases the number ofsetReaction()API calls per tool invocation. On Discord, rate limits apply at 5 requests per 5 seconds per channel. For tools that execute very rapidly (<200ms apart), this could theoretically approach rate limits.How is that risk mitigated?
applyEmojialready skips duplicate emoji sends (same emoji => no-op)enqueue()) prevents concurrent API callsCurrent review state
What is the next action?
What is still waiting on author, maintainer, CI, or external proof?
Which bot or reviewer comments were addressed?