Skip to content

Agent cannot distinguish owner vs contact messages in DM history #32061

@mactsk

Description

@mactsk

Re-filing of #12482 (closed by stale bot)

Version: 2026.3.1 (confirmed still present)

Problem

In DM conversations, all messages in the history context appear as coming from the contact — the agent cannot distinguish between messages sent by the owner and messages sent by the contact. This is because msg.key.fromMe is not propagated through inboundMessagebuildInboundLineformatInboundEnvelope.

Expected behavior

The agent should be able to see which messages in the DM history were sent by the owner vs the contact. Without this, the LLM sees all DM history as [WhatsApp +39...] text with no way to know who said what.

Workaround

I've been maintaining a local bundle patch since v2026.2.9 that:

  1. Adds fromMe to the inboundMessage event
  2. Passes fromMe through buildInboundLine
  3. In formatInboundEnvelope, prefixes the owner's own messages with (self) in DM context

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions