diff --git a/crates/agent/src/edit_agent/evals.rs b/crates/agent/src/edit_agent/evals.rs index 84cdd101f57546a0bfbc86a290bf1f453e69a979..2cc6a6b4242a07b688d1232cd39d13797c70b02b 100644 --- a/crates/agent/src/edit_agent/evals.rs +++ b/crates/agent/src/edit_agent/evals.rs @@ -1581,6 +1581,7 @@ impl EditAgentTest { let template = crate::SystemPromptTemplate { project: &project_context, available_tools: tool_names, + model_name: None, }; let templates = Templates::new(); template.render(&templates).unwrap() diff --git a/crates/agent/src/templates.rs b/crates/agent/src/templates.rs index 72a8f6633cb7bb926580dbb4f9e65ec032162d93..db787d834e63746fdbea9e837f4fd0615f85c984 100644 --- a/crates/agent/src/templates.rs +++ b/crates/agent/src/templates.rs @@ -38,6 +38,7 @@ pub struct SystemPromptTemplate<'a> { #[serde(flatten)] pub project: &'a prompt_store::ProjectContext, pub available_tools: Vec, + pub model_name: Option, } impl Template for SystemPromptTemplate<'_> { @@ -79,9 +80,11 @@ mod tests { let template = SystemPromptTemplate { project: &project, available_tools: vec!["echo".into()], + model_name: Some("test-model".to_string()), }; let templates = Templates::new(); let rendered = template.render(&templates).unwrap(); assert!(rendered.contains("## Fixing Diagnostics")); + assert!(rendered.contains("test-model")); } } diff --git a/crates/agent/src/templates/system_prompt.hbs b/crates/agent/src/templates/system_prompt.hbs index ca324fad7acccb3e50f1140c8f99d52319d159d4..4620647135631fdb367b0dc2604e89770a938c07 100644 --- a/crates/agent/src/templates/system_prompt.hbs +++ b/crates/agent/src/templates/system_prompt.hbs @@ -150,6 +150,12 @@ Otherwise, follow debugging best practices: Operating System: {{os}} Default Shell: {{shell}} +{{#if model_name}} +## Model Information + +You are powered by the model named {{model_name}}. + +{{/if}} {{#if (or has_rules has_user_rules)}} ## User's Custom Instructions diff --git a/crates/agent/src/thread.rs b/crates/agent/src/thread.rs index 64e512690beeaebd4a343bc5f2df473c795aed3f..4c0fb00163744e66b5644a0fe76b1aa853fb8237 100644 --- a/crates/agent/src/thread.rs +++ b/crates/agent/src/thread.rs @@ -1928,6 +1928,7 @@ impl Thread { let system_prompt = SystemPromptTemplate { project: self.project_context.read(cx), available_tools, + model_name: self.model.as_ref().map(|m| m.name().0.to_string()), } .render(&self.templates) .context("failed to build system prompt")