Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions crates/chat-cli/src/cli/agent/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,9 @@ pub enum AgentConfigError {
#[serde(rename_all = "camelCase", deny_unknown_fields)]
#[schemars(description = "An Agent is a declarative way of configuring a given instance of q chat.")]
pub struct Agent {
#[serde(rename = "$schema", default = "default_schema")]
pub schema: String,
#[serde(rename = "$schema", skip_serializing_if = "Option::is_none", default)]
#[schemars(skip)]
pub schema: Option<String>,
/// Name of the agent
pub name: String,
/// This field is not model facing and is mostly here for users to discern between agents
Expand Down Expand Up @@ -180,7 +181,7 @@ pub struct Agent {
impl Default for Agent {
fn default() -> Self {
Self {
schema: default_schema(),
schema: None,
name: DEFAULT_AGENT_NAME.to_string(),
description: Some("Default agent".to_string()),
prompt: Default::default(),
Expand Down Expand Up @@ -990,10 +991,6 @@ pub fn queue_permission_override_warning(
)?)
}

fn default_schema() -> String {
"https://raw.githubusercontent.com/aws/amazon-q-developer-cli/refs/heads/main/schemas/agent-v1.json".into()
}

// Check if a tool reference is MCP-specific (not @builtin and starts with @)
pub fn is_mcp_tool_ref(s: &str) -> bool {
// @builtin is not MCP, it's a reference to all built-in tools
Expand Down Expand Up @@ -1277,7 +1274,7 @@ mod tests {
allowed_tools.insert("@server3/tool_*".to_string());

let agent = Agent {
schema: "test".to_string(),
schema: None,
name: "test-agent".to_string(),
description: None,
prompt: None,
Expand Down
Loading