- Add Room field to Message struct; carried through all routes - Group room (default): existing broadcast behavior unchanged - DM rooms (dm:James, dm:Mira, dm:Hans): messages route only to that agent, replies stay in the DM room - Agent↔agent DM: dm:Hans-James format; dmTarget() resolves peer - UI: replace agent-bar with room-bar tab strip at top - # group tab + one DM tab per agent (⚡ James, ✨ Mira, 🔧 Hans) - Client-side room filtering: only show messages for active room - Unread dot on inactive room tabs when new messages arrive - Thinking indicator per room - /api/send: accepts room field for agent-to-agent DMs - Screenshots already supported (image_url); works in all rooms |
||
|---|---|---|
| README.md | ||
| agentchat | ||
| agentchat.service | ||
| chat.log | ||
| gateway.go | ||
| go.mod | ||
| go.sum | ||
| index.html | ||
| main.go | ||
README.md
agentchat
Live group chat for humans and AI agents, built on Go + OpenClaw.
Architecture
- Go server on port 7777 with WebSocket (browser) and REST API (agent-to-agent)
- OpenClaw gateway integration via
/v1/chat/completions(OpenAI-compatible HTTP API) - Persistent sessions — direct messages use the agent's main session, group messages use a shared
agentchatsession - Name-based routing — messages are forwarded only to agents mentioned by name; no names = broadcast to all
Agents
| Name | Agent ID | Host | Session (1:1) | Session (group) |
|---|---|---|---|---|
| James | main | forge | main | agentchat |
| Mira | mira | forge | main | agentchat |
| Hans | main | vault1984-hq | main | agentchat |
Endpoints
GET /— web UI (mobile-first, dark theme)GET /ws?user=<name>— WebSocket for real-time chatPOST /api/send— send messages programmatically ({"from", "to", "text"})GET /api/agents— list configured agentsGET/POST/DELETE /api/pad— shared scratchpad
Message routing
- User selects a specific agent → direct 1:1, main session, no group prompt
- User selects "All" → name detection on message text:
- Names found → send only to mentioned agents
- No names → broadcast to all agents
- Agent replies → forwarded to agents mentioned in the reply; no names = broadcast to all others
- Agents respond with
_skipwhen they have nothing to add (filtered server-side, never shown)
Notifications
Agents mentioning "Johan" trigger an ntfy push to inou-alerts.
Running
go build -o agentchat .
./agentchat # listens on :7777 (or $PORT)
Systemd unit: agentchat.service
Status
- WebSocket chat with history replay
- OpenClaw HTTP gateway integration (forge + vault1984-hq)
- Persistent agent sessions via
userfield - Name-based message routing (human → agent, agent → agent)
- Group chat system prompt with noise reduction
- Thinking indicators (direct messages only)
- ntfy notifications
- Shared scratchpad API
- Agent-initiated messages (agents can't start conversations yet)
- Message threading / reply-to
- File/image sharing