fix(messaging-groups): rename channel destination on agent-name clash#2564
Open
kky wants to merge 1 commit into
Open
fix(messaging-groups): rename channel destination on agent-name clash#2564kky wants to merge 1 commit into
kky wants to merge 1 commit into
Conversation
When wiring a chat to an agent, `createMessagingGroupAgent` auto- creates an `agent_destinations` row whose `local_name` comes from the messaging group's name. If that name collides with the agent's own name, the agent's destination addendum reads as if it can send to itself — and a real failure mode is the agent refusing to address its own chat because `from="homie"` looks like a self-reference rather than a chat destination named "homie". Hit in practice: Signal group named "homie" wired to the Homie agent produced an agent_destinations row with `local_name='homie'`. The agent's outbound replies went to its peer agent edge instead of the chat, because addressing "homie" felt like addressing itself. Detect the clash and fall back to a neutral `chat` (with `chat-2`, `chat-3` suffixes if multiple chats are wired). Operator can still rename via the agent-network skill's edge tools later — this is just the auto-default. The slug comparison normalizes via the same `normalizeName` already used for destination naming, so any case/punctuation variant of the agent's name is also caught. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Type of Change
.claude/skills/<name>/, no source changes)Description
What. When
createMessagingGroupAgentauto-creates anagent_destinationsrow whoselocal_namewould collide with the agent's own name, fall back tochat(withchat-2,chat-3suffixes for additional wires) instead of using the colliding name.This comes up on chat apps like Signal where a 1:1 group is used by the operator to communicate directly with a specific agent; the group name typically will be the name of the agent, as it simulates DM.
Why. Hit in practice: a Signal group named
Agent Xwas wired to theAgent Xagent. The auto-createdagent_destinationsrow gotlocal_name='agent-x', and the agent's outbound replies started going to its peer agent edge instead of the chat — because addressingAgent X(the group) from the agent named Agent X looked like a self-reference rather than a chat destination.How it works. Compare the messaging group's slug to the agent's normalized name via the same
normalizeNamehelper already used for destination naming, so any case/punctuation variant of the agent's name is caught. On collision, usechatas the destination'slocal_name. Ifchatis also taken (multiple wires), append-2,-3, etc.The operator can still rename via the agent-network skill's edge tools later — this only affects the auto-default at wire time.
How it was tested. Reproduced by creating a messaging group with the same name as an agent; the group was default named to avoid collision, avoid the appearance of self-reference, and messages were delivered correctly.