Skip to content

Commit f212b66

Browse files
authored
fix(agent): always includes dummy tool (#2433)
* always includes dummy tool * eliminates version field eliminates version field
1 parent da3785f commit f212b66

File tree

3 files changed

+3
-17
lines changed

3 files changed

+3
-17
lines changed

crates/chat-cli/src/cli/agent/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ pub enum AgentConfigError {
122122
pub struct Agent {
123123
/// Name of the agent
124124
pub name: String,
125-
/// Version of the agent config
126-
pub version: String,
127125
/// This field is not model facing and is mostly here for users to discern between agents
128126
#[serde(default)]
129127
pub description: Option<String>,
@@ -169,7 +167,6 @@ impl Default for Agent {
169167
fn default() -> Self {
170168
Self {
171169
name: DEFAULT_AGENT_NAME.to_string(),
172-
version: "0.1.0".to_string(),
173170
description: Some("Default agent".to_string()),
174171
prompt: Default::default(),
175172
mcp_servers: Default::default(),
@@ -794,7 +791,6 @@ mod tests {
794791
const INPUT: &str = r#"
795792
{
796793
"name": "some_agent",
797-
"version": "0.1.0",
798794
"description": "My developer agent is used for small development tasks like solving open issues.",
799795
"prompt": "You are a principal developer who uses multiple agents to accomplish difficult engineering tasks",
800796
"mcpServers": {

crates/chat-cli/src/cli/chat/tool_manager.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ use crate::cli::agent::{
6363
McpServerConfig,
6464
};
6565
use crate::cli::chat::cli::prompts::GetPromptError;
66+
use crate::cli::chat::consts::DUMMY_TOOL_NAME;
6667
use crate::cli::chat::message::AssistantToolUse;
6768
use crate::cli::chat::server_messenger::{
6869
ServerMessengerBuilder,
@@ -896,7 +897,8 @@ impl ToolManager {
896897
serde_json::from_str::<HashMap<String, ToolSpec>>(include_str!("tools/tool_index.json"))?
897898
.into_iter()
898899
.filter(|(name, _)| {
899-
is_allow_all
900+
name == DUMMY_TOOL_NAME
901+
|| is_allow_all
900902
|| is_allow_native
901903
|| tool_list.contains(name)
902904
|| tool_list.contains(&format!("@builtin/{name}"))

docs/agent-format.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ The agent configuration file for each agent is a JSON file. The filename (withou
55
Every agent configuration file can include the following sections:
66

77
- [`name`](#name-field) — The name of the agent (optional, derived from filename if not specified).
8-
- [`version`](#version-field) - The version of the agent config.
98
- [`description`](#description-field) — A description of the agent.
109
- [`prompt`](#prompt-field) — High-level context for the agent (not yet implemented).
1110
- [`mcpServers`](#mcpservers-field) — The MCP servers the agent has access to.
@@ -29,17 +28,6 @@ The `name` field specifies the name of the agent. This is used for identificatio
2928

3029
Note: While this field can be included in the configuration file, it will be overridden by the filename when the agent is loaded.
3130

32-
## Version Field
33-
34-
The `version` field specifies the version of the agent config. This is currently not being utilized though you must specify it.
35-
Currently, the default version is "0.1.0"
36-
37-
```json
38-
{
39-
"version": "0.1.0"
40-
}
41-
```
42-
4331
## Description Field
4432

4533
The `description` field provides a description of what the agent does. This is primarily for human readability and helps users distinguish between different agents.

0 commit comments

Comments
 (0)