Skip to content

Prepend sender identity to channel messages for agent context#790

Open
pbranchu wants to merge 1 commit intoRightNow-AI:mainfrom
pbranchu:fix/sender-identity
Open

Prepend sender identity to channel messages for agent context#790
pbranchu wants to merge 1 commit intoRightNow-AI:mainfrom
pbranchu:fix/sender-identity

Conversation

@pbranchu
Copy link

Summary

The channel bridge now prefixes messages with [From: Name <email>] so agents know who is speaking.

Problem

When messages arrive from channel adapters, the agent receives only the raw text with no sender context. In multi-user rooms, the agent has no way to know who sent the message. For agents that act on behalf of specific users (e.g., checking different email accounts or calendars), this makes it impossible to route correctly.

Fix

In dispatch_message, prepend [From: Display Name <email>] to the text before sending to the agent. The email is sourced from the sender_email metadata field if available. If the display name is empty, the text is sent as-is.

Updated bridge integration tests to use contains() assertions instead of exact match.

Test plan

  • cargo check passes
  • Bridge integration tests updated and passing

🤖 Generated with Claude Code

The bridge now prefixes messages with [From: Name <email>] so agents
know who is speaking. Essential for multi-user rooms and for agents
that need to act on behalf of specific users (e.g., checking the
correct email account or calendar).

Updated bridge integration tests to match the new format.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant