From 3a8a1754efd2d10ab3af777b50cc88904b9b3afd Mon Sep 17 00:00:00 2001 From: Edvard Date: Thu, 19 Feb 2026 16:07:25 -0500 Subject: [PATCH] fix(channel): replace hardcoded Discord bot text with generic channel text The Channel Capabilities section in build_system_prompt() was hardcoded to say "You are running as a Discord bot" for ALL channels, including Telegram. This caused the LLM to misidentify itself and reference Discord-specific features regardless of the actual channel. Replace with generic "messaging bot" text. Per-channel delivery instructions already exist via channel_delivery_instructions(). Co-Authored-By: Claude Opus 4.6 --- src/channels/mod.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/channels/mod.rs b/src/channels/mod.rs index 6c3b4cc81..8be603f83 100644 --- a/src/channels/mod.rs +++ b/src/channels/mod.rs @@ -1357,10 +1357,7 @@ pub fn build_system_prompt( // ── 8. Channel Capabilities ───────────────────────────────────── prompt.push_str("## Channel Capabilities\n\n"); - prompt.push_str( - "- You are running as a Discord bot. You CAN and do send messages to Discord channels.\n", - ); - prompt.push_str("- When someone messages you on Discord, your response is automatically sent back to Discord.\n"); + prompt.push_str("- You are running as a messaging bot. Your response is automatically sent back to the user's channel.\n"); prompt.push_str("- You do NOT need to ask permission to respond — just respond directly.\n"); prompt.push_str("- NEVER repeat, describe, or echo credentials, tokens, API keys, or secrets in your responses.\n"); prompt.push_str("- If a tool output contains credentials, they have already been redacted — do not mention them.\n\n"); @@ -3785,8 +3782,8 @@ mod tests { "missing Channel Capabilities section" ); assert!( - prompt.contains("running as a Discord bot"), - "missing Discord context" + prompt.contains("running as a messaging bot"), + "missing channel context" ); assert!( prompt.contains("NEVER repeat, describe, or echo credentials"),