Skip to content

fix(reply): keep attachments and actions when reply text was already sent - #129230

Merged
steipete merged 1 commit into
mainfrom
codex/qa-reply-dedupe-20260825
Aug 25, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa-reply-dedupe-20260825

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where assistant replies silently lost attachments, buttons, portable presentations, channel-specific content, locations, or delivery operations when a messaging tool had already sent the reply text. An already-sent legacy attachment could also erase distinct unsent attachment URLs.

Why This Change Was Made

The canonical reply-deduplication owner previously decided whether a complete payload was redundant by checking only its text and attachment fields. Reuse the existing authoritative reply-content predicate instead, preserve untouched plural attachment URLs while removing genuinely duplicated media, and delete the obsolete text-only deduplication wrapper.

Production delta: 19 additions / 26 deletions (net -7). No configuration, protocol, authentication, persistence, or plugin-SDK changes.

User Impact

Already-delivered text is still deduplicated, while every remaining unsent attachment, button, location, channel payload, and enabled delivery operation reaches its intended conversation.

Evidence

  • Authentic pre-fix owner-boundary regression: 7 failing cases for unsent media, presentation, legacy controls, channel data, location, and both enabled pin forms; the disabled-pin control already passed.
  • Fixed owner and caller suites: OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/auto-reply/reply/agent-runner-payloads.test.ts src/auto-reply/reply/reply-payloads.test.ts --reporter=dot — 112 passed, 1 existing Windows-only skip.
  • Interactive sibling coverage: 45 additional passing tests.
  • Targeted formatter and lint checks passed; changed-file classifier selected only core production and core tests.
  • Fresh independent structured review: clean; no accepted or actionable findings.

@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 25, 2026
@steipete
steipete merged commit c907865 into main Aug 25, 2026
231 checks passed
@steipete
steipete deleted the codex/qa-reply-dedupe-20260825 branch August 25, 2026 10:32
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 25, 2026
@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 6:17 AM ET / 10:17 UTC.

ClawSweeper review

What this changes

The PR updates route-scoped message-tool reply deduplication so already-sent text does not suppress remaining media, interactive content, channel data, locations, or enabled delivery operations.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open: this member-authored PR repairs a current silent reply-delivery defect with a shared owner-boundary change; it should proceed through normal exact-head CI and maintainer landing review.

Priority: P1
Reviewed head: 1476bea40e0b869cff8ec9461ea39be8f4540b19

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative owner-boundary fix with concrete regression coverage, pending normal exact-head CI.
Proof confidence 🌊 off-meta tidepool Not applicable: The external-contributor real-behavior-proof gate does not apply to this member-authored PR; its body nevertheless reports focused after-fix test evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor real-behavior-proof gate does not apply to this member-authored PR; its body nevertheless reports focused after-fix test evidence.
Evidence reviewed 5 items Current-main defect: At the recorded main revision, text deduplication retained a payload only when media fields existed, so a duplicate text payload with presentations, controls, channel data, a location, or delivery operation could be discarded.
Owner-boundary repair: The proposed shared filter strips sent media first, then retains a text duplicate only when the canonical reply-content predicate finds remaining deliverable content.
Shared content contract and callers: The predicate recognizes media, presentation blocks, legacy interactive blocks, nonempty channel data, and explicit extra content; both agent-run and queued follow-up delivery invoke the same dedupe function before renderability filtering.
Findings None None.
Security None None.

Live Verification

Command: pnpm openclaw --help

Result: PASS (completed)

pnpm openclaw --help
runner@runnervm76f27:/tmp/clawsweeper-live-proof-129230-Th7BL1/target$ pnpm openclaw --help
$ node scripts/run-node.mjs --help
pnpm openclaw --help
[openclaw] Building TypeScript (dist is stale: missing_build_stamp - build stamp missing).
[openclaw] Building bundled plugin assets.
[canvas] build: node scripts/bundle-a2ui.mjs
[log] ‹DIR›/a2ui.bundle.js  chunk │ size: 399.96 kB
[log] ‹DIR›/a2ui-v0.9.bundle.js  chunk │ size: 615.66 kB
[log]
[success] rolldown v1.2.0 Finished in 106.04 ms
[diffs] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts curated
[diffs-language-pack] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts full
[discord] build: node --import tsx ../../scripts/build-discord-activity-sdk.mts
[tsdown-build] invocation 1/2 finished in 0.6s
node_modules/playwright-core/lib/coreBundle.js (65821:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65821:29 ]
       │
 65821 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/playwright-core/lib/coreBundle.js (65828:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65828:29 ]
       │
 65828 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2343:30) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2343:31 ]
      │
 2343 │           ASM_CONSTS[start] = eval(func);
      │                               ──┬─
      │                                 ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2366:32) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2366:33 ]
      │
 2366 │           moduleExports[name] = eval(func);
      │                                 ──┬─
      │                                   ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

[tsdown-build] invocation 2/2 finished in 12.8s
[plugin-control-plane-loads] verified 35 built modules with native require and checked doctor closures
runtime-postbuild: 11 phases completed in 4076ms (slowest: built plugin control-plane loads 2825ms)

OpenClaw 2026.8.1 (1476bea) — All your chats, one OpenClaw.

Usage: openclaw [options] [command]

Options:
  --container ‹name›   Run the CLI inside a running Podman/Docker container named ‹name› (default: env OPENCLAW_CONTAINER)
  --dev                Dev profile: isolate state under ~/.openclaw-dev, default gateway port 19001, and shift derived ports (browser/canvas)
  -h, --help           Display help for command
  --log-level ‹level›  Global log level override for file + console
… output truncated …

Assertions:

  • PASS expect_output: Usage: openclaw [options] [command]

How this fits together

Messaging tools can send content directly, while the auto-reply pipeline prepares the final assistant payload for channel delivery. The shared deduplication owner removes only content already sent to the same route before the final payload reaches a channel.

flowchart LR
  A[Assistant reply payload] --> B[Reply preparation]
  C[Message tool send evidence] --> D[Route-scoped deduplication]
  B --> D
  D --> E[Remaining reply content]
  E --> F[Channel delivery]
  F --> G[Conversation output]
Loading

Before merge

  • Resolve merge risk (P1) - Exact-head CI is still pending, and the targeted test results reported in the PR body were not independently rerun during this read-only review.
  • Complete next step (P2) - No repair lane is needed: the active member-authored PR already contains the bounded owner-path repair; await exact-head CI and normal landing review.
Agent review details

Security

None.

PR surface

Source -7, Tests +78. Total +71 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 19 26 -7
Tests 1 78 0 +78
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 97 26 +71

Review metrics

Metric Value Why it matters
Production versus test LOC production -7 (19 added, 26 deleted); tests +78 The bug fix simplifies the production dedupe owner while adding focused behavioral coverage.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain one canonical route-scoped dedupe path that removes only already-delivered content while preserving any remaining deliverable reply payload content.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain one canonical route-scoped dedupe path that removes only already-delivered content while preserving any remaining deliverable reply payload content.

Do we have a high-confidence way to reproduce the issue?

Yes—source establishes a high-confidence owner-path reproduction: provide a payload whose text matches sent text but whose structured content remains unsent, then run final reply preparation.

Is this the best way to solve the issue?

Yes—the shared route-scoped dedupe owner is the narrowest maintainable repair because both agent-run and queued follow-up delivery flow through it.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against c29d4f9d6a3e.

Labels

Label changes:

  • add P1: Current main can silently suppress user-visible reply content after a message-tool send on an otherwise valid agent/channel workflow.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor real-behavior-proof gate does not apply to this member-authored PR; its body nevertheless reports focused after-fix test evidence.

Label justifications:

  • P1: Current main can silently suppress user-visible reply content after a message-tool send on an otherwise valid agent/channel workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor real-behavior-proof gate does not apply to this member-authored PR; its body nevertheless reports focused after-fix test evidence.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the central auto-reply deduplication refactor and the current correction. (role: feature owner and recent area contributor; confidence: high; commits: c4dccc614d0f, 1476bea40e0b; files: src/auto-reply/reply/reply-payloads-dedupe.ts, src/auto-reply/reply/agent-runner-payloads.ts)
  • vincentkoc: Authored earlier fixes establishing explicit delivery-operation handling in this dedupe path. (role: adjacent delivery-behavior contributor; confidence: high; commits: b9d3e65f74db, c44d831488aa; files: src/auto-reply/reply/reply-payloads-dedupe.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant