Skip to content

fix(messaging-groups): rename channel destination on agent-name clash#2564

Open
kky wants to merge 1 commit into
nanocoai:mainfrom
kky:pr/messaging-group-name-clash
Open

fix(messaging-groups): rename channel destination on agent-name clash#2564
kky wants to merge 1 commit into
nanocoai:mainfrom
kky:pr/messaging-group-name-clash

Conversation

@kky
Copy link
Copy Markdown

@kky kky commented May 20, 2026

Type of Change

  • Feature skill - adds a channel or integration (source code changes + SKILL.md)
  • Utility skill - adds a standalone tool (code files in .claude/skills/<name>/, no source changes)
  • Operational/container skill - adds a workflow or agent skill (SKILL.md only, no source changes)
  • Fix - bug fix or security fix to source code
  • Simplification - reduces or simplifies source code
  • Documentation - docs, README, or CONTRIBUTING changes only

Description

What. When createMessagingGroupAgent auto-creates an agent_destinations row whose local_name would collide with the agent's own name, fall back to chat (with chat-2, chat-3 suffixes 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 X was wired to the Agent X agent. The auto-created agent_destinations row got local_name='agent-x', and the agent's outbound replies started going to its peer agent edge instead of the chat — because addressing Agent 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 normalizeName helper already used for destination naming, so any case/punctuation variant of the agent's name is caught. On collision, use chat as the destination's local_name. If chat is 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.

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>
@kky kky requested review from gabi-simons and gavrielc as code owners May 20, 2026 01:03
@github-actions github-actions Bot added follows-guidelines PR was created using the current contributing template PR: Fix Bug fix labels May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

follows-guidelines PR was created using the current contributing template PR: Fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant