Summary
In Matrix multi-account setups, a message generated by agent/account A can be sent out by Matrix account B when the message is sent via a tool/action path.
Expected behavior
A message generated from account A should always be sent by account A.
Actual behavior
A tool/action send generated in account A's session is published in Matrix from another active account (account B).
Reproduction
- Configure Matrix with multiple accounts under
channels.matrix.accounts and route each to a different agent.
- In one room, mention two agents in one message (for example,
@bot-a @bot-b ...).
- Let one agent trigger a follow-up send via tool/action (for example, pinging another bot/user in-room).
- Observe the follow-up is sent by a different Matrix account than the one whose session generated it.
Notes
- Mention detection on inbound is correct (event
m.mentions.user_ids is as expected).
- Session records show the originating agent/account generated the follow-up text.
- The final Matrix sender can still be a different account.
Suspected root cause
accountId appears to be dropped in Matrix action/tool-send path before final send client resolution.
Likely relevant files:
extensions/matrix/src/actions.ts
extensions/matrix/src/tool-actions.ts
extensions/matrix/src/matrix/actions/messages.ts supports account-aware opts, so this may be a context propagation gap upstream.
Impact
- Cross-account identity confusion in shared rooms
- Multi-account routing trust is broken for tool/action sends
- Can look like an unrelated bot is speaking/responding
Summary
In Matrix multi-account setups, a message generated by agent/account A can be sent out by Matrix account B when the message is sent via a tool/action path.
Expected behavior
A message generated from account A should always be sent by account A.
Actual behavior
A tool/action send generated in account A's session is published in Matrix from another active account (account B).
Reproduction
channels.matrix.accountsand route each to a different agent.@bot-a @bot-b ...).Notes
m.mentions.user_idsis as expected).Suspected root cause
accountIdappears to be dropped in Matrix action/tool-send path before final send client resolution.Likely relevant files:
extensions/matrix/src/actions.tsextensions/matrix/src/tool-actions.tsextensions/matrix/src/matrix/actions/messages.tssupports account-aware opts, so this may be a context propagation gap upstream.Impact