Skip to content

fix(whatsapp): identify voice-note captions as text in delivery receipts - #205381

Merged
vincentkoc merged 1 commit into
mainfrom
fix/whatsapp-caption-receipt-kinds-c34
Nov 26, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/whatsapp-caption-receipt-kinds-c34

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

When the WhatsApp listener sent a voice note with a caption, WhatsApp accepted two messages. The combined delivery receipt labeled both as media, so a consumer reading the receipt could not identify the caption as text.

User Impact

The receipt now identifies the audio message as media and the caption as text, in send order. It keeps both provider message IDs and counts the pair as one outbound activity.

Why This Change Was Made

The send API already records the kind and provider key of each accepted message. The combined receipt now carries those physical parts forward and numbers them in delivery order.

Evidence

Replayed a 251-frame Ogg voice note with a caption through the listener and send API against an in-memory transport. The original returned two media entries. The fix returned media at index 0 and text at index 1, with the same primary ID, destination, participant and sender metadata.

Eight send scenarios covered the caption, voice-only and whitespace-only inputs, plain text, separate calls, video, poll and the higher-level voice/text split. Formatting, focused lint and the line-cap check passed. Hosted Vitest passed 32 send-api cases, including the two child receipt kinds and partial caption acceptance. WhatsApp sender tests · Protected CI

@vincentkoc vincentkoc self-assigned this Nov 25, 2026
@clawsweeper

clawsweeper Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added channel: whatsapp-web Channel integration: whatsapp-web size: XS labels Nov 25, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:other This issue has meaningful maintainer-visible impact outside the owned taxonomy. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 25, 2026
@clawsweeper

clawsweeper Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR preserves each accepted WhatsApp message’s kind when combining voice-note and caption delivery receipts.

Example: Send an Ogg voice note with caption “voice text”, receiving IDs voice-1 and voice-text-1.

  • Before: Both receipt parts are labeled media.
  • After: voice-1 is media at index 0 and voice-text-1 is text at index 1.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused implementation has no identified defect, but the supplied mocked transport replay does not satisfy the required runtime proof.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Receipt consumers cannot distinguish a separately delivered text caption from the accompanying voice note.
Reason: The maintainer-authored change restores accurate physical-message classification with a focused repair and no new public API or configuration.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR fixes a receipt-classification bug still present on main, with no introduced correctness defect found; draft status and an unattributed dependency-check failure remain.

Reviewed head: c6bd98bc5f575628a6866c5cce29ff49cfbff604

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Provide redacted logs or terminal output from a real WhatsApp listener send showing media/text receipt parts in order, both provider IDs, and one activity event; the reported replay uses an in-memory transport.
Agent review details

How this fits together

The WhatsApp listener’s send API converts accepted transport results into receipts consumed by delivery bookkeeping and callers.

flowchart LR
  A[WhatsApp listener] --> B[Send API]
  B --> C[Transport sends]
  C --> D[Accepted child receipts]
  D --> E[Combined receipt]
  E --> F[Delivery consumers]
Loading

Technical review

Best possible solution:

Preserve accepted child receipts in the existing WhatsApp combiner while retaining provider identities, send order, and logical activity accounting.

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

Source tracing establishes the failure: the send API captures media and text separately, but current main recreates both receipt parts with the aggregate media kind; no target code was executed.

Is this the best way to solve the issue?

The patch fixes the classification loss at its producer using the existing receipt-composition owner, and the added assertions protect the distinct kind and ordering contract without new scaffolding.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7d2b9c37cbd3.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +11, Tests +4. Total +15 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 16 5 +11
Tests 1 4 0 +4
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 20 5 +15

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Provide the real listener-send evidence described in the proof assessment.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 25, 2026, 9:24 AM ET / 14:24 UTC.

@vincentkoc
vincentkoc marked this pull request as ready for review November 25, 2026 14:35
@vincentkoc
vincentkoc merged commit 38a9f4b into main Nov 26, 2026
252 of 254 checks passed
@vincentkoc
vincentkoc deleted the fix/whatsapp-caption-receipt-kinds-c34 branch November 26, 2026 02:19
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Nov 26, 2026
…irement-rule

* origin/main: (172 commits)
  test(gateway): expect a revoked person's Goal retry to be hidden as not found (#205698)
  fix: keep browser disabled when only hardening relay authentication (#203137)
  fix: recover Linux stream automations after command-anchor crashes (#203149)
  fix(whatsapp): identify voice-note captions as text in delivery receipts (#205381)
  fix(test): unblock restart-auth plugin and worker publication qualification (#205679)
  chore(ui): refresh control ui locales (#205691)
  fix: reduce memory during SQLite usage refresh (#201064)
  fix(plugins): readmit native captures with a dangling host link
  chore(i18n): refresh native locales (#205680)
  fix(update): hash SQLite lock bytes as zeros so Windows exclusion cannot fail verification (#205668)
  fix(skill-workshop): skip the skill diet for skills with Markdown outside support directories (#204881)
  fix(plugins): clarify dated SDK migration notices (#200932)
  fix: keep the resident launcher when reinstalling Gateway (#205655)
  fix: show the whole reply when you reopen a TUI session (#200455)
  test(ui): wait for restored speech player authorization (#199502)
  feat: let agents post approved GitHub comments (#204301)
  fix(agents): honor imageMaxDimensionPx at the provider and CLI image handoffs (#205663)
  chore(ui): refresh control ui locales (#205664)
  fix(google): preserve playback when Google Live splits audio into parts (#205364)
  fix: show named characters in exported session messages (#205362)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: whatsapp-web Channel integration: whatsapp-web impact:other This issue has meaningful maintainer-visible impact outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS 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