openclaw - ✅(Solved) Fix Include participant identity and quoted reply context in gateway inbound log [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#63589Fetched 2026-04-10 03:42:39
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
referenced ×2commented ×1cross-referenced ×1

Fix Action

Fixed

PR fix notes

PR #63615: feat(whatsapp): log inbound sender + reply context #63589

Description (problem / solution / changelog)

Summary

  • Problem: WhatsApp gateway inbound logs only included {from,to,body,timestamp,...}; for group chats from is the group JID, so the participant identity is missing. Quoted-reply context was also missing from the log line.
  • Why it matters: Downstream log parsers (cron/offline pipelines) cannot attribute group messages to participants or reconstruct reply threads when messages are mention-gated and never reach a live agent session.
  • What changed: Include senderJid/senderE164/senderName and quoted-reply fields (replyTo*) in the WhatsApp inbound logger payload.
  • What did NOT change (scope boundary): No changes to mention gating, message formatting for the agent, or delivery behavior—this is log payload enrichment only.

Change Type (select all)

  • Feature

Scope (select all touched areas)

  • Gateway / orchestration
  • Integrations

Linked Issue/PR

User-visible / Behavior Changes

Inbound log lines for WhatsApp now include participant identity for group messages and quoted reply context fields (when present).

Security Impact (required)

  • New permissions/capabilities? (No)
  • Secrets/tokens handling changed? (No)
  • New/changed network calls? (No)
  • Command/tool execution surface changed? (No)
  • Data access scope changed? (No)

Repro + Verification

Environment

  • OS: Linux
  • Integration/channel: WhatsApp (web)

Steps

  1. Run the WhatsApp inbound monitor unit tests.
  2. Verify that the inbound logger call includes participant identity and reply context keys.

Expected

  • Inbound log payload includes senderJid/senderE164/senderName for group messages.
  • Inbound log payload includes replyToId/replyToBody/replyToSender/... when the message quotes a previous message.

Actual

  • Before: log payload omitted these fields.
  • After: log payload includes them.

Evidence

  • Passing test after change:
    • pnpm test -- extensions/whatsapp/src/monitor-inbox.captures-media-path-image-messages.test.ts

Human Verification (required)

  • Verified scenarios:
    • Group inbound message logs participant identity.
    • Quoted reply logs include reply context fields.
  • Edge cases checked:
    • Non-group messages still log as before (only additional optional fields present).
  • What I did not verify:
    • Live WhatsApp session logs (unit tests only).

Compatibility / Migration

  • Backward compatible? (Yes)
  • Config/env changes? (No)
  • Migration needed? (No)

Risks and Mitigations

None.

Changed files

  • extensions/whatsapp/src/inbound/monitor.ts (modified, +8/-0)
  • extensions/whatsapp/src/monitor-inbox.captures-media-path-image-messages.test.ts (modified, +0/-238)
  • extensions/whatsapp/src/monitor-inbox.test.ts (added, +320/-0)

Code Example

inboundLogger.info({
    from: inbound.from,        // group JID, not participant
    to: self.e164 ?? "me",
    body: enriched.body,
    mediaPath, mediaType, mediaFileName,
    timestamp
}, "inbound message");

---

inboundLogger.info({
    from: inbound.from,
    to: self.e164 ?? "me",
    body: enriched.body,
    senderJid: inbound.senderJid,
    senderE164: inbound.senderE164,
    senderName: inbound.senderName,
    replyToId: enriched.replyContext?.replyToId,
    replyToBody: enriched.replyContext?.replyToBody,
    replyToSender: enriched.replyContext?.replyToSender,
    mediaPath, mediaType, mediaFileName,
    timestamp
}, "inbound message");
RAW_BUFFERClick to expand / collapse

Problem

When WhatsApp group messages are logged by the gateway, the inboundLogger.info() call only writes {from, to, body, timestamp} to the log file. The from field is the group JID, so there is no way to identify which participant sent the message. Quoted reply context (the message being replied to) is also absent.

This matters for any downstream processing of group messages outside of a live session — for example, a cron job that extracts group messages from the log to monitor a family WhatsApp group for itinerary changes.

Current behaviour

The gateway's enqueueInboundMessage() already builds a rich inboundMessage object with:

  • senderJid, senderE164, senderName — participant identity
  • replyToId — stanza ID of the quoted message
  • replyToBody — text of the quoted message
  • replyToSender, replyToSenderJid, replyToSenderE164 — who was quoted

For messages that reach the agent (pass mention gating), this data is formatted beautifully into the message body — [Replying to <sender>] <quoted body> [/Replying] and [from: Sender Name (+E164)]. This works perfectly.

But the inboundLogger.info() call discards all of this:

inboundLogger.info({
    from: inbound.from,        // group JID, not participant
    to: self.e164 ?? "me",
    body: enriched.body,
    mediaPath, mediaType, mediaFileName,
    timestamp
}, "inbound message");

Requested change

Include participant identity and reply context fields in the logged object:

inboundLogger.info({
    from: inbound.from,
    to: self.e164 ?? "me",
    body: enriched.body,
    senderJid: inbound.senderJid,
    senderE164: inbound.senderE164,
    senderName: inbound.senderName,
    replyToId: enriched.replyContext?.replyToId,
    replyToBody: enriched.replyContext?.replyToBody,
    replyToSender: enriched.replyContext?.replyToSender,
    mediaPath, mediaType, mediaFileName,
    timestamp
}, "inbound message");

This is a minimal change — the data is already computed, it just needs to be included in the log line.

Use case

I have a cron job that monitors a family holiday WhatsApp group (with requireMention: true) by parsing the gateway log. Messages filtered by mention gating are still logged, which is great — but without participant identity, I can't tell who said what, and without quoted reply context, I can't follow threaded conversations like:

  1. Ivan: "Can you book the osteopath?"
  2. Gia (quoting Ivan): "Yes, 4:30pm available"
  3. Ivan (quoting Gia): "Great, let's book it"

Currently this appears as three anonymous messages with no threading.

Environment

  • OpenClaw v2026.4.8
  • WhatsApp channel with groupPolicy: "open", group-level requireMention: true

extent analysis

TL;DR

Update the inboundLogger.info() call to include participant identity and reply context fields in the logged object.

Guidance

  • Review the enqueueInboundMessage() function to understand how the rich inboundMessage object is built, and apply similar logic to the inboundLogger.info() call.
  • Include the senderJid, senderE164, senderName, replyToId, replyToBody, and replyToSender fields in the logged object to capture participant identity and reply context.
  • Verify that the updated log output includes the expected fields and data.
  • Test the updated logging with different message scenarios, including quoted replies and messages from various participants.

Example

inboundLogger.info({
    from: inbound.from,
    to: self.e164 ?? "me",
    body: enriched.body,
    senderJid: inbound.senderJid,
    senderE164: inbound.senderE164,
    senderName: inbound.senderName,
    replyToId: enriched.replyContext?.replyToId,
    replyToBody: enriched.replyContext?.replyToBody,
    replyToSender: enriched.replyContext?.replyToSender,
    mediaPath, mediaType, mediaFileName,
    timestamp
}, "inbound message");

Notes

This update assumes that the inbound and enriched objects contain the necessary data. If these objects are not populated correctly, additional debugging may be required.

Recommendation

Apply the workaround by updating the inboundLogger.info() call to include the participant identity and reply context fields, as this will provide the necessary data for downstream processing without requiring a version upgrade.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix Include participant identity and quoted reply context in gateway inbound log [1 pull requests, 1 comments, 2 participants]