fix: all messages route to main session on all agents

All three agents (James/Mira on forge, Hans on Zurich) now use
session="main" for both direct and group messages. This lands
agentchat in each agent's primary thread — same context as
webchat/Telegram.

Previous v1.1 used "agentchat"/"agentchat-direct" sessions which
were isolated silos. Session "main" routes to agent:main:main on
whichever OC gateway is called, including Hans on Zurich.
This commit is contained in:
James 2026-03-08 04:48:30 -04:00
parent 9ff3c8cde9
commit 9184080682
1 changed files with 5 additions and 5 deletions

10
main.go
View File

@ -243,14 +243,14 @@ func imageURLToBase64(imageURL string) string {
func callAgent(cfg AgentConfig, message, from string, direct bool, imageURL string) (string, error) { func callAgent(cfg AgentConfig, message, from string, direct bool, imageURL string) (string, error) {
var prompt, session string var prompt, session string
if direct { if direct {
// 1:1 or name-targeted — use dedicated agentchat-direct session (NOT "main", to avoid // 1:1 explicit-To message — use main session so it lands in each agent's primary thread
// conflicting with the webchat session that may be active simultaneously)
prompt = fmt.Sprintf("[agentchat from %s — reply inline, do not use the message tool]\n%s", from, message) prompt = fmt.Sprintf("[agentchat from %s — reply inline, do not use the message tool]\n%s", from, message)
session = "agentchat-direct" session = "main"
} else { } else {
// Group — use agentchat session with group rules // Group broadcast/name-mention — also use main session so agentchat context is shared
// with the agent's primary thread (webchat/Telegram). All three agents on all nodes.
prompt = fmt.Sprintf("%s\n\n[group message from %s]\n%s", systemPrompt, from, message) prompt = fmt.Sprintf("%s\n\n[group message from %s]\n%s", systemPrompt, from, message)
session = "agentchat" session = "main"
} }
// Resolve image to base64 data URL if present // Resolve image to base64 data URL if present