fix: suppress duplicate visible message.send deliveries#80445
Conversation
|
Codex review: needs real behavior proof before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. source-reproducible: current main has documented duplicate assistant-confirmation suppression expectations but final delivery still sends through 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. PR egg Where did the egg go?
Real behavior proof Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge Security Review findings
Review detailsBest possible solution: Keep the exact normalized route/text duplicate-final predicate, but make outbound idempotency share or await the in-flight send result, then add a concurrent-failure regression and redacted live Gateway/Discord proof or an explicit maintainer override. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main has documented duplicate assistant-confirmation suppression expectations but final delivery still sends through Is this the best way to solve the issue? No, not yet. Exact route/text suppression is the right shape, but the outbound idempotency helper must not report an in-flight replay as suppressed before the original send has succeeded. Label justifications:
Full review comments:
Overall correctness: patch is incorrect What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 46d53d3b593a. |
|
Thanks. I was mentioned because this touches the durable final-delivery path. Before this can move forward, I’d like to see the duplicate predicate narrowed to exact normalized Please also add a regression test for the near-duplicate case, update the PR body with redacted real |
|
Addressed the duplicate predicate/test/proof requests:
Validation run in an isolated source checkout: CI=1 vitest run src/agents/command/delivery.test.ts --bail=1 --testNamePattern 'duplicate|warning'Result: the targeted duplicate/warning cases passed. I did not use a production Gateway or live Discord channel; the proof is at the mocked Discord delivery seam. |
|
Follow-up update: I added one more commit to cover a second duplicate-delivery shape observed after the original PR work. Reviewer map:
Fresh validation update:
Root-cause seam:
Patch shape:
Validation commands run in an isolated source checkout: node scripts/run-vitest.mjs run --config test/vitest/vitest.infra.config.ts src/infra/outbound/deliver.test.ts src/infra/outbound/message.test.ts
node scripts/run-vitest.mjs run --config test/vitest/vitest.agents-tools.config.ts src/agents/tools/message-tool.test.ts
node scripts/run-vitest.mjs run --config test/vitest/vitest.auto-reply-reply.config.ts src/auto-reply/reply/agent-runner-payloads.test.ts src/auto-reply/reply/followup-delivery.test.ts
node_modules/.bin/oxfmt --check src/agents/tools/message-tool.ts src/agents/tools/message-tool.test.ts src/infra/outbound/deliver.ts src/infra/outbound/deliver.test.ts src/infra/outbound/message.ts src/infra/outbound/message.test.ts src/infra/outbound/outbound-send-service.ts src/infra/outbound/send-idempotency.ts
node_modules/.bin/oxlint src/agents/tools/message-tool.ts src/agents/tools/message-tool.test.ts src/infra/outbound/deliver.ts src/infra/outbound/deliver.test.ts src/infra/outbound/message.ts src/infra/outbound/message.test.ts src/infra/outbound/outbound-send-service.ts src/infra/outbound/send-idempotency.ts
git diff --checkObserved results:
Scope boundary / caveat:
|
5db7361 to
dac0771
Compare
|
Updated this PR head to address the remaining ClawSweeper route-matching finding. Reviewer map:
Validation run in an isolated source checkout: node --no-maglev node_modules/vitest/vitest.mjs run --config test/vitest/vitest.agents-support.config.ts src/agents/command/delivery.test.ts --pool=threads --maxWorkers=1
node --no-maglev node_modules/vitest/vitest.mjs run --config test/vitest/vitest.agents-tools.config.ts src/agents/tools/message-tool.test.ts --pool=threads --maxWorkers=1
node --no-maglev node_modules/vitest/vitest.mjs run --config test/vitest/vitest.infra.config.ts src/infra/outbound/deliver.test.ts src/infra/outbound/message.test.ts --pool=threads --maxWorkers=1
node --no-maglev node_modules/vitest/vitest.mjs run --config test/vitest/vitest.auto-reply-reply.config.ts src/auto-reply/reply/agent-runner-payloads.test.ts src/auto-reply/reply/followup-delivery.test.ts --pool=threads --maxWorkers=1
node_modules/.bin/oxfmt --check src/agents/command/delivery.ts src/agents/command/delivery.test.ts
node_modules/.bin/oxlint src/agents/command/delivery.ts src/agents/command/delivery.test.ts
git diff --check HEAD~1..HEADObserved result: delivery command tests passed (25 tests), message-tool tests passed (49 tests), focused infra outbound tests passed (97 tests), focused auto-reply tests passed (49 tests), focused format/lint passed, and diff/conflict-marker checks passed. Caveat: GitHub currently reports this PR as conflict-bearing against current Boundary: this is still isolated source-checkout validation only. It does not claim production Gateway/runtime or live Discord proof, so the live behavior proof or maintainer-override gate remains. /clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
9dfc471 to
fcd79f6
Compare
|
Non-production proof refresh for PR head Reviewer map:
Fresh validation boundary: isolated OpenClaw source checkout with mocked/synthetic Discord and outbound delivery seams only. No production/live Gateway, runtime config/state, real Discord channel, or real Discord send was used or claimed. Commands run: Result: Interpretation: this proves the requested non-production seam behavior only. Exact duplicate final delivery is suppressed; warning/correction final replies and one-sided route mismatches still deliver; replayed explicit sends dedupe through the idempotency key path. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
fcd79f6 to
d355e2d
Compare
|
Closing this PR as superseded/deferred to reduce the open external PR queue. The duplicate visible If maintainers still want this exact behavior, I will re-cut it later as a smaller current-main PR with fresh proof instead of continuing this stale broad branch. |
Summary
message.sendcalls in agent run contextReview notes
message.sendfollowed by a longer final reply that adds a warning; that final reply is delivered instead of suppressedTests
git diff --checkCI=1 vitest run src/agents/command/delivery.test.ts --bail=1 --testNamePattern 'duplicate|warning'Real behavior proof
message.sendresponse and then also produce a final reply with the same visible text, causing duplicate visible delivery. Follow-up review also identified two adjacent safety boundaries: near-duplicate final replies with added warning/correction text must still deliver, and one-sided route metadata must not count as a duplicate route match.fcd79f6f32e0309a7d6ca1e712165713868ff91b, using mocked/synthetic Discord and outbound delivery seams. No production/live Gateway, runtime config, runtime state, real Discord channel, or real Discord send was used or claimed.message.sendare suppressed at final delivery; warning/correction final replies still deliver; one-sidedthreadId/accountIdroute metadata mismatches still deliver; replayed explicit sends with the same idempotency scope/content/route dedupe while non-idempotent repeated sends remain visible.