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 <noreply@anthropic.com>
This commit is contained in:
parent
e0ca73336a
commit
3a8a1754ef
1 changed files with 3 additions and 6 deletions
|
|
@ -1357,10 +1357,7 @@ pub fn build_system_prompt(
|
||||||
|
|
||||||
// ── 8. Channel Capabilities ─────────────────────────────────────
|
// ── 8. Channel Capabilities ─────────────────────────────────────
|
||||||
prompt.push_str("## Channel Capabilities\n\n");
|
prompt.push_str("## Channel Capabilities\n\n");
|
||||||
prompt.push_str(
|
prompt.push_str("- You are running as a messaging bot. Your response is automatically sent back to the user's channel.\n");
|
||||||
"- 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 do NOT need to ask permission to respond — just respond directly.\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("- 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");
|
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"
|
"missing Channel Capabilities section"
|
||||||
);
|
);
|
||||||
assert!(
|
assert!(
|
||||||
prompt.contains("running as a Discord bot"),
|
prompt.contains("running as a messaging bot"),
|
||||||
"missing Discord context"
|
"missing channel context"
|
||||||
);
|
);
|
||||||
assert!(
|
assert!(
|
||||||
prompt.contains("NEVER repeat, describe, or echo credentials"),
|
prompt.contains("NEVER repeat, describe, or echo credentials"),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue