diff --git a/main.go b/main.go index 3d6f2d3..0022e37 100644 --- a/main.go +++ b/main.go @@ -243,14 +243,14 @@ func imageURLToBase64(imageURL string) string { func callAgent(cfg AgentConfig, message, from string, direct bool, imageURL string) (string, error) { var prompt, session string if direct { - // 1:1 or name-targeted — use dedicated agentchat-direct session (NOT "main", to avoid - // conflicting with the webchat session that may be active simultaneously) + // 1:1 explicit-To message — use main session so it lands in each agent's primary thread prompt = fmt.Sprintf("[agentchat from %s — reply inline, do not use the message tool]\n%s", from, message) - session = "agentchat-direct" + session = "main" } 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) - session = "agentchat" + session = "main" } // Resolve image to base64 data URL if present