Skip to content

Conversation

@jpelaez-23blocks
Copy link
Contributor

Summary

  • Agent names now unique per-host (like email: auth@host1auth@host2)
  • Added name@host format support for explicit agent targeting
  • Drag-and-drop to move agents between folders in the sidebar

Test plan

  • Create agents with same name on different hosts - should succeed
  • Use name@host format in messaging
  • Drag agent to different folder - verify tags update

🤖 Generated with Claude Code

Juan Pelaez and others added 4 commits January 8, 2026 23:16
When sending messages to agents on remote hosts, use the alias in the
'to' field instead of the UUID. Remote hosts can resolve aliases locally
but don't know about UUIDs from other hosts.

- For remote hosts: use alias (remote host resolves it locally)
- For local hosts: continue using agent ID (more reliable)

Fixes: "Unknown recipient: <uuid>" error when sending cross-host messages

Co-Authored-By: Claude Opus 4.5 <[email protected]>
In a mesh network, "local" is meaningless. This refactor replaces the
broken relative concept with absolute hostname-based identity.

Changes:
- Add isSelf(hostId) for self-detection instead of type checks
- Add getSelfHostId() returning os.hostname()
- Add getSelfHost() and getPeerHosts() replacing getLocalHost/getRemoteHosts
- Auto-migrate legacy id:'local' configs to actual hostname
- Replace all 'type === local' checks with isSelf() calls
- Remove type:'remote' assignments (type field deprecated)
- Client-side uses isLocalhostUrl() since browser can't use os.hostname()

Key files:
- lib/hosts-config.ts: Core identity functions and migration
- lib/messageQueue.ts: Use isSelf() for routing decisions
- lib/tmux-discovery.ts: Use isSelf() for session discovery
- app/api/hosts/*: Updated peer registration and exchange

Backward compat: Deprecated getLocalHost() and getRemoteHosts() kept as
aliases. Legacy 'local' ID auto-migrates on config load.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Agent Identity Improvements:
- Agent names now unique per-host (like email: auth@host1 ≠ auth@host2)
- getAgentByName() accepts optional hostId parameter
- Added getAgentByNameAnyHost() for global searches
- resolveAlias() supports name@host format for explicit targeting
- createAgent/updateAgent uniqueness checks scoped to host

Drag-and-Drop Tree Management:
- Agents can be dragged between folders in the sidebar
- Drop targets on Level 1 and Level 2 folder headers
- Visual feedback with ring highlight during drag
- API call updates agent tags on drop
- Moving agents doesn't change their identity (ID, name)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@jpelaez-23blocks jpelaez-23blocks merged commit fd60cbe into main Jan 15, 2026
2 checks passed
@jpelaez-23blocks jpelaez-23blocks deleted the fix/interhost-messages branch January 15, 2026 21:30
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.

2 participants