From 1aa60552bc14e182930fb2869695d6eab5e885f5 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Fri, 10 Apr 2026 02:40:00 -0400 Subject: [PATCH] Use Role::System for agent step prompts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Step prompts in oneshot agents are instructions, not user messages — use system_msg instead of user_msg. Co-Authored-By: ProofOfConcept --- src/agent/oneshot.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/agent/oneshot.rs b/src/agent/oneshot.rs index 81bcc91..cc590bb 100644 --- a/src/agent/oneshot.rs +++ b/src/agent/oneshot.rs @@ -193,7 +193,7 @@ impl AutoAgent { if next_step < self.steps.len() { backend.push_node( - AstNode::user_msg(&self.steps[next_step].prompt)).await; + AstNode::system_msg(&self.steps[next_step].prompt)).await; next_step += 1; } @@ -218,8 +218,8 @@ impl AutoAgent { let text = result.text; if text.is_empty() { dbglog!("[auto] {} empty response, retrying", self.name); - backend.push_node(AstNode::user_msg( - "[system] Your previous response was empty. \ + backend.push_node(AstNode::system_msg( + "Your previous response was empty. \ Please respond with text or use a tool." )).await; continue; @@ -234,7 +234,7 @@ impl AutoAgent { } self.current_phase = self.steps[next_step].phase.clone(); backend.push_node( - AstNode::user_msg(&self.steps[next_step].prompt)).await; + AstNode::system_msg(&self.steps[next_step].prompt)).await; next_step += 1; dbglog!("[auto] {} step {}/{}", self.name, next_step, self.steps.len());