diff --git a/src/agent/loop_.rs b/src/agent/loop_.rs index fd04b63..08ce859 100644 --- a/src/agent/loop_.rs +++ b/src/agent/loop_.rs @@ -436,6 +436,7 @@ struct ParsedToolCall { /// Execute a single turn of the agent loop: send messages, parse tool calls, /// execute tools, and loop until the LLM produces a final text response. /// When `silent` is true, suppresses stdout (for channel use). +#[allow(clippy::too_many_arguments)] pub(crate) async fn agent_turn( provider: &dyn Provider, history: &mut Vec, @@ -461,6 +462,7 @@ pub(crate) async fn agent_turn( /// Execute a single turn of the agent loop: send messages, parse tool calls, /// execute tools, and loop until the LLM produces a final text response. +#[allow(clippy::too_many_arguments)] pub(crate) async fn run_tool_call_loop( provider: &dyn Provider, history: &mut Vec, diff --git a/src/channels/mod.rs b/src/channels/mod.rs index de9b20c..f8cfe17 100644 --- a/src/channels/mod.rs +++ b/src/channels/mod.rs @@ -484,6 +484,16 @@ pub fn build_system_prompt( std::env::consts::OS, ); + // ── 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 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"); + if prompt.is_empty() { "You are ZeroClaw, a fast and efficient AI assistant built in Rust. Be helpful, concise, and direct.".to_string() } else { @@ -1569,6 +1579,25 @@ mod tests { assert!(truncated.is_char_boundary(truncated.len())); } + #[test] + fn prompt_contains_channel_capabilities() { + let ws = make_workspace(); + let prompt = build_system_prompt(ws.path(), "model", &[], &[], None, None); + + assert!( + prompt.contains("## Channel Capabilities"), + "missing Channel Capabilities section" + ); + assert!( + prompt.contains("running as a Discord bot"), + "missing Discord context" + ); + assert!( + prompt.contains("NEVER repeat, describe, or echo credentials"), + "missing security instruction" + ); + } + #[test] fn prompt_workspace_path() { let ws = make_workspace();