Skip to content

fix: preserve quoted replies in text sends#302

Merged
steipete merged 6 commits into
mainfrom
clawsweeper/issue-openclaw-wacli-301
Jul 17, 2026
Merged

fix: preserve quoted replies in text sends#302
steipete merged 6 commits into
mainfrom
clawsweeper/issue-openclaw-wacli-301

Conversation

@clawsweeper

@clawsweeper clawsweeper Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • construct complete quoted-reply context from the referenced stored message
  • set the quoted participant correctly for incoming and own outgoing messages
  • reject missing or unsupported quote targets before sending
  • preserve reply fields through the sync --follow IPC delegate

Why

send text --reply-to currently emits only a stanza ID and optional participant. WhatsApp accepts and delivers the message but can omit the recipient-side quote box because QuotedMessage is absent. Direct-message lookups can also miss silently and still report a successful send.

Validation

  • table-driven DM and group quote-context tests
  • incoming and own-outgoing participant tests
  • missing-row and unsupported-content failure tests proving no send occurs
  • IPC request JSON round-trip coverage for reply fields
  • ordinary text-send regression coverage
  • full repository gate
  • redacted recipient-side proof for direct and IPC-delegated sends

Closes #301

Thanks @odilorg for the detailed report and live reproduction evidence.

@clawsweeper clawsweeper Bot added clawsweeper Tracked by ClawSweeper automation clawsweeper:autogenerated PR created automatically by ClawSweeper clawsweeper:autofix Maintainer opted this PR into bounded ClawSweeper-reviewed autofix without merge labels Jul 13, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 message-delivery 🚨 Merging this PR could drop, duplicate, misroute, suppress, or wrongly target messages. labels Jul 13, 2026
@clawsweeper

clawsweeper Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Codex review: needs maintainer review before merge. Reviewed July 16, 2026, 3:17 PM ET / 19:17 UTC.

Summary
The branch builds complete quoted-message context for text replies, normalizes PN/LID participants, preserves reply fields through IPC, adds regression tests, and updates the unreleased changelog.

Reproducibility: yes. at source level. The linked issue provides a concrete IPC-delegated DM reproduction, and the current-main stanza-only context path explains the observed successful delivery without a visible quote.

Review metrics: 3 noteworthy metrics.

  • Changed surface: 4 files; 476 additions, 14 deletions. The work is concentrated in text sending, IPC regression coverage, send regression coverage, and release notes.
  • Test coverage change: 342 additions across 2 test files. Most of the patch expansion is focused coverage for participant identity, unsupported targets, and delegated reply fields.
  • Current checks: 2 successful, 1 in progress. The remaining exact-head test job is the ordinary merge gate.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #301
Summary: This PR is the active candidate fix for the linked quoted-reply delivery issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Risk before merge

  • [P1] The exact-head test check must finish successfully before merge; the other reported checks already pass.

Maintainer options:

  1. Decide the mitigation before merge
    Merge the exact reviewed head after the full required gate passes, retaining stored-message quote construction, the explicit unsynced-group fallback, and PN/LID normalization coverage.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P2] No separate repair job is indicated; the active PR should proceed through exact-head test completion and normal maintainer merge review.

Security
Cleared: The patch changes Go send logic, tests, IPC fields, and release notes without adding dependencies, workflows, permissions, secret access, or downloaded code.

Review details

Best possible solution:

Merge the exact reviewed head after the full required gate passes, retaining stored-message quote construction, the explicit unsynced-group fallback, and PN/LID normalization coverage.

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

Yes at source level. The linked issue provides a concrete IPC-delegated DM reproduction, and the current-main stanza-only context path explains the observed successful delivery without a visible quote.

Is this the best way to solve the issue?

Yes. Constructing context from the referenced stored message while preserving the documented unsynced-group fallback and normalizing PN/LID participants is the narrowest maintainable repair.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: The PR fixes silently lost quoted-reply semantics in a bounded WhatsApp text-send path without evidence of broader runtime unavailability.
  • 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: This autogenerated bot repair PR is exempt from the external-contributor proof gate; its body nevertheless reports redacted recipient-side proof for direct and IPC-delegated sends.
Evidence reviewed

What I checked:

  • Current-main defect remains: The base implementation constructs reply context with the stanza ID and optional participant but without the stored quoted message, matching the linked issue's successful delivery with a missing quote box. (cmd/wacli/send.go, b1eb33538df3)
  • Complete quote construction: The current PR head resolves the appropriate self identity and builds reply context from the referenced stored message before sending the protobuf message. (cmd/wacli/send.go:224, 10fb41ed42fa)
  • IPC preservation: The branch includes JSON round-trip coverage showing that ReplyTo and ReplyToSender survive delegation through sync --follow. (cmd/wacli/send_ipc_test.go:89, 10fb41ed42fa)
  • Regression coverage: Table-driven tests cover direct and group chats, incoming and own outgoing messages, missing or unsupported targets, PN/LID identity handling, and ordinary text sends. (cmd/wacli/send_test.go:310, 10fb41ed42fa)
  • Prior blocker resolved: The earlier P1 finding about the documented unsynced group-reply path was repaired in the third commit, and the latest completed review cycle reported no findings. (cmd/wacli/send.go, b92d1917c684)
  • Latest participant refinements: Two subsequent commits refine quoted replies in LID chats and normalize quoted participants on the current head. (cmd/wacli/send.go, 10fb41ed42fa)

Likely related people:

  • steipete: Authored the two latest commits refining LID-chat behavior and quoted participant normalization on the current head. (role: recent quoted-reply contributor; confidence: high; commits: 8d83bab8b06c, 10fb41ed42fa; files: cmd/wacli/send.go, cmd/wacli/send_test.go)
  • dinakars777: The prior review history routes the send CLI contract and unsynced-reply compatibility boundary to this person. (role: send CLI reviewer; confidence: medium; files: cmd/wacli/send.go, docs/send.md)
  • draix: The prior feature-history review connects this person to the original send CLI behavior affected by the patch. (role: original send-path contributor; confidence: medium; files: cmd/wacli/send.go, docs/send.md)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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 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.
Review history (4 earlier review cycles)
  • reviewed 2026-07-13T21:51:40.981Z sha 706d774 :: found issues before merge. :: [P1] Preserve the documented unsynced group-reply path
  • reviewed 2026-07-13T22:00:46.556Z sha 706d774 :: found issues before merge. :: [P1] Preserve the documented unsynced group-reply path
  • reviewed 2026-07-13T22:13:17.334Z sha b92d191 :: passed. :: none
  • reviewed 2026-07-13T22:26:06.052Z sha b92d191 :: needs maintainer review before merge. :: none

@clawsweeper

clawsweeper Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

🦞🧹
ClawSweeper autofix is enabled.

  • Head: 706d774b1da4
  • Label: clawsweeper:autofix
  • Action: exact-head review queued (workflow sweep.yml, event repository_dispatch).
  • Flow: review this head, repair/rebase only if needed, then re-review the exact repaired head until no actionable findings remain.

This is fix-only; I will not merge this PR.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

🦞✅
ClawSweeper autofix is complete for this exact head.

Source: clawsweeper[bot]
Feedback: structured ClawSweeper verdict: pass (sha=b92d1917c684c1d960b3245ea4f165a111dc5db3)
Head: b92d1917c684

No actionable findings remain. I removed the repair-loop label and left the PR open for maintainer review and merge.

Automerge progress:

  • 2026-07-13 22:02:26 UTC review requested repair 706d774b1da4 (structured ClawSweeper needs-human verdict with repairable P-severity findings...)
  • 2026-07-13 22:06:29 UTC review queued b92d1917c684 (after repair)
  • 2026-07-13 22:15:10 UTC review passed b92d1917c684 (structured ClawSweeper verdict: pass (sha=b92d1917c684c1d960b3245ea4f165a111dc5...)

@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 message-delivery 🚨 Merging this PR could drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. clawsweeper:autofix Maintainer opted this PR into bounded ClawSweeper-reviewed autofix without merge labels Jul 13, 2026
@steipete

Copy link
Copy Markdown
Collaborator

Maintainer repair and exact-head verification complete on 10fb41ed42fadccc025c5e93601de59478e1593a.

The review found and fixed three participant-identity edge cases beyond the original patch:

  • outgoing quotes in LID-addressed chats and groups now use the linked account LID
  • an explicit reply sender bypasses unnecessary group/self identity lookup
  • stored and explicit participants are normalized to non-device JIDs

The branch also adds the Unreleased changelog entry and keeps the documented unsynced-group fallback.

Proof:

  • pnpm format:check && pnpm lint && pnpm test && pnpm build && git diff --check — passed
  • focused text-send regression suite — passed
  • AutoReview local mode — clean
  • AutoReview branch mode against origin/main — clean, no actionable findings
  • hosted test, docker, and linux-release-builds checks — passed on the exact head

This checkout has no authenticated WhatsApp account, so I could not independently repeat recipient-side delivery. The linked issue reproduction and the PR's prior redacted direct/IPC proof remain the available live behavior evidence.

@steipete

Copy link
Copy Markdown
Collaborator

Live proof executed on the exact head (10fb41e) with an authenticated store: built CGO_ENABLED=1 go build -tags sqlite_fts5, then

  • send text --to <self> --message "..." --reply-to <text-msg-id> → accepted and delivered (server ack, visible in chat)
  • send text --reply-to <document-msg-id> → correct rejection: "stored message content is not supported for quoted text replies" (quote path demonstrably active)

Together with the direct/group/LID/IPC unit matrix and clean hosted CI, landing. Thanks @odilorg.

@steipete
steipete merged commit 8e4f893 into main Jul 17, 2026
3 checks passed
@steipete
steipete deleted the clawsweeper/issue-openclaw-wacli-301 branch July 17, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:autogenerated PR created automatically by ClawSweeper clawsweeper Tracked by ClawSweeper automation P2 Normal priority bug or improvement with limited blast radius. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

send text --reply-to: message delivers but the quote is silently dropped (0.11.1)

1 participant