diff --git a/src/server/subagent.rs b/src/server/subagent.rs index eb2f09f..8ef1b8a 100644 --- a/src/server/subagent.rs +++ b/src/server/subagent.rs @@ -64,8 +64,8 @@ impl SubagentRunner for ServerSubagentRunner { "You are a threaded fork of agent {}. You share their tools, their \ memory boundaries, their dual-state architecture. After you respond, \ your N+1 pass will surface observations back to them.\n\n\ - Your final message will be returned to the caller.\n\n{}", - params.parent_agent_id, params.prompt + Your final message will be returned to the caller.", + params.parent_agent_id ); // Build tool definitions @@ -93,8 +93,14 @@ impl SubagentRunner for ServerSubagentRunner { ), ); - // Initial messages: system prompt + user prompt - let mut messages = vec![BifrostMessage::text("system", system_prompt)]; + // Initial messages: system prompt + user prompt. + // The task must be a *user* message: providers that hoist system + // messages into a separate field are left with an empty messages + // array otherwise, and reject the request. + let mut messages = vec![ + BifrostMessage::text("system", system_prompt), + BifrostMessage::text("user", params.prompt.clone()), + ]; let mut final_content = String::new(); let mut tool_round = 0u32;