fix(discord): harden reply delivery accounting#86716
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed May 29, 2026, 1:15 AM ET / 05:15 UTC. Summary PR surface: Source +10, Tests +43. Total +53 across 7 files. Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Review detailsBest possible solution: Retry the Codex review after fixing the execution failure. Do we have a high-confidence way to reproduce the issue? Unclear. The review failed before ClawSweeper could establish a reproduction path. Is this the best way to solve the issue? Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model gpt-5.5, reasoning high; reviewed against 8eb5ff08c86b. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +10, Tests +43. Total +53 across 7 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
|
|
ClawSweeper PR egg 🔥 Warming up: real-behavior proof passed; findings, security review, or rank-up moves are still in progress. Hatch commandComment Hatchability rules:
What is this egg doing here?
|
Scope
sendandsendMessageactions.Non-goals
NO_REPLYhandling before final delivery.Risk
Low. The change is scoped to Discord reply accounting and message-tool send target extraction. The main behavioral change is surfacing empty final replies as delivery failures instead of silent success.
Rollback
Revert commit
64f2dc4b2d.Real behavior proof
Behavior or issue addressed: Discord final reply delivery after applying the equivalent local runtime hotfix no longer silently completes for normal visible replies; the live channel continued receiving final assistant replies and the Discord transport stayed healthy.
Real environment tested: Richard's real OpenClaw gateway using Discord channel
#starlord-infra, installed OpenClaw2026.5.22with the equivalent local Discord delivery-accounting hotfix applied before this PR was ported back to source.Exact steps or command run after the patch:
#starlord-infrachannel.openclaw channels status --probe && openclaw gateway stabilityafter the visible Discord replies landed.Evidence after fix:
Observed result after fix: The same real Discord setup delivered visible final replies after the hotfix, while the gateway reported Discord
worksand queue depth0. This PR ports that runtime hotfix into source and adds regression coverage for the expired-interaction accounting path, sanitizer-empty final path, andsend/sendMessageextraction mismatch.What was not tested: I did not force a real expired Discord slash-interaction token in production; that path is covered by unit regression because manufacturing an expired live token would be brittle and user-visible.
Verification
node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-discord.config.ts extensions/discord/src/monitor/native-command-reply.test.ts extensions/discord/src/monitor/reply-delivery.test.ts extensions/discord/src/channel-actions.test.ts-> 3 files / 38 tests passednode scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.extensions.json extensions/discord/src/monitor/native-command-reply.ts extensions/discord/src/monitor/native-command-agent-reply.ts extensions/discord/src/monitor/reply-delivery.ts extensions/discord/src/channel-actions.ts extensions/discord/src/monitor/native-command-reply.test.ts extensions/discord/src/monitor/reply-delivery.test.ts extensions/discord/src/channel-actions.test.ts-> passedcorepack pnpm exec oxfmt --check extensions/discord/src/monitor/native-command-reply.ts extensions/discord/src/monitor/native-command-agent-reply.ts extensions/discord/src/monitor/reply-delivery.ts extensions/discord/src/channel-actions.ts extensions/discord/src/monitor/native-command-reply.test.ts extensions/discord/src/monitor/reply-delivery.test.ts extensions/discord/src/channel-actions.test.ts-> passednode scripts/run-tsgo.mjs -p tsconfig.extensions.json --noEmit-> passed