fix(whatsapp): propagate fromMe through inbound message pipeline#32167
Merged
steipete merged 2 commits intoopenclaw:mainfrom Mar 2, 2026
Merged
fix(whatsapp): propagate fromMe through inbound message pipeline#32167steipete merged 2 commits intoopenclaw:mainfrom
steipete merged 2 commits intoopenclaw:mainfrom
Conversation
Contributor
Greptile SummarySuccessfully propagates WhatsApp's Key Changes:
Implementation Quality:
Confidence Score: 5/5
Last reviewed commit: 9a6670b |
The `fromMe` flag from Baileys' WAMessage.key was only used for access-control filtering and then discarded. This meant agents could not distinguish owner-sent messages from contact messages in DM conversations (everything appeared as from the contact). Add `fromMe` to `WebInboundMessage`, store it during message construction, and thread it through `buildInboundLine` → `formatInboundEnvelope` so DM transcripts prefix owner messages with `(self):`. Closes openclaw#32061 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9a6670b to
2bcc9ff
Compare
Contributor
|
Landed via temp rebase onto main.
Thanks @scoootscooob! |
mrosmarin
added a commit
to mrosmarin/openclaw
that referenced
this pull request
Mar 2, 2026
* main: (154 commits) fix: harden exec allowlist regex literal handling (openclaw#32162) (thanks @stakeswky) fix(exec): escape regex literals in allowlist path matching fix: OpenAI OAuth TLS preflight gating (openclaw#32051) (thanks @alexfilatov) Auth: gate OpenAI OAuth TLS preflight in doctor Fix TLS cert preflight classification false positive Add OpenAI OAuth TLS preflight and doctor prerequisite check fix(gateway): hot-reload channelHealthCheckMinutes without full restart refactor: harden plugin install flow and main DM route pinning fix: propagate whatsapp inbound fromMe context (openclaw#32167) (thanks @scoootscooob) fix(whatsapp): propagate fromMe through inbound message pipeline refactor: harden msteams lifecycle and attachment flows fix(config): move sensitive-schema hint warnings to debug test(perf): reduce heavy fixture and guardrail overhead perf(core): speed up routing, pairing, slack, and security scans refactor: unify queueing and normalize telegram slack flows fix: harden bundled plugin install fallback semantics (openclaw#32096) (thanks @scoootscooob) fix(plugins): prefer bundled plugin ids over bare npm specs fix: distinguish warning message for non-OpenClaw vs missing npm package fix(plugins): fall back to bundled plugin when npm spec resolves to non-OpenClaw package (openclaw#32019) fix: harden msteams revoked-context fallback delivery (openclaw#27224) (thanks @openperf) ...
dawi369
pushed a commit
to dawi369/davis
that referenced
this pull request
Mar 3, 2026
OWALabuy
pushed a commit
to kcinzgg/openclaw
that referenced
this pull request
Mar 4, 2026
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In WhatsApp DM conversations, agents cannot distinguish owner-sent messages from contact messages. The
fromMeflag from Baileys'WAMessage.keyis extracted during inbound processing (for access-control filtering) but then discarded — it is never stored inWebInboundMessageor passed to the transcript formatter.This means in self-chat or any scenario where owner messages appear in the conversation, they look identical to contact messages, breaking the agent's ability to reason about conversation context.
Re-filing of #12482 (closed by stale bot).
Fix
src/web/inbound/types.ts— AddfromMe?: booleantoWebInboundMessagetypesrc/web/inbound/monitor.ts— StoreBoolean(msg.key?.fromMe)when constructing the inbound messagesrc/auto-reply/envelope.ts— AcceptfromMeinformatInboundEnvelope; prefix DM body with(self):when truesrc/web/auto-reply/monitor/message-line.ts— Passmsg.fromMethroughbuildInboundLine→formatInboundEnvelopeAll changes are additive (optional fields) — fully backward compatible.
Test plan
fromMe: trueproduces(self): bodyprefixfromMe: truestill uses sender label (no(self)prefix)tsgo --noEmitclean on changed filesCloses #32061
🤖 Generated with Claude Code