fix(discord): harden reply delivery accounting#86716
Conversation
|
Thanks for the contribution. This PR still needs the requested real-behavior proof, and the branch has been idle since that ask. Close as stalled and unproven: this external Discord delivery PR is idle on the same May 26, 2026 head, has carried a needs-proof ask since June 15, 2026, the supplied proof does not exercise the changed PR-head failure paths, and source review still finds a dispatcher-accounting blocker. So I’m closing this for now to keep the review queue honest. Please reopen or open a fresh PR with real-behavior proof (a live run, logs, or a reproducible validation transcript) and it will be reviewed again. Review detailsBest possible solution: Close this stale PR now; if the fix is still needed, reopen or send a fresh branch that routes false Discord interaction delivery into dispatcher failure or cancellation accounting and includes redacted real Discord proof for one changed path. Do we have a high-confidence way to reproduce the issue? Yes, from source inspection of the PR head: Is this the best way to solve the issue? No as submitted. Returning an explicit delivery result is a reasonable direction, but the best fix must convert a false interaction delivery into dispatcher-visible failed or cancelled accounting and prove at least one changed Discord path in a real setup. Security review: Security review cleared: Security review cleared: the diff is limited to Discord TypeScript source and tests and does not add dependencies, workflows, secrets handling, package-resolution changes, or generated code. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against b4e0c5306cd0. |
|
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?
|
|
ClawSweeper applied the proposed close for this PR.
|
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