Skip to content

Commit 969b8c0

Browse files
committed
Remove context tool and update tool_index with resource tool
- Remove context tool from all Tool enum matches - Remove context.rs file and module references - Update tool_index.json to replace context with resource tool - Fix remaining context references in hooks.rs and tool_manager.rs - LLM now has unified resource tool instead of separate context tool - Clean separation: /resource slash command + resource LLM tool
1 parent f0ddd52 commit 969b8c0

File tree

5 files changed

+23
-610
lines changed

5 files changed

+23
-610
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,10 @@ impl HookExecutor {
240240

241241
// Create tool instance based on name and arguments
242242
let tool = match tool_name {
243-
"context" => {
244-
let context_tool: crate::cli::chat::tools::context::Context =
243+
"resource" => {
244+
let resource_tool: crate::cli::chat::tools::resource::Resource =
245245
serde_json::from_value(args.clone())?;
246-
Tool::Context(context_tool)
246+
Tool::Resource(resource_tool)
247247
},
248248
"fs_read" => {
249249
let fs_read_tool: crate::cli::chat::tools::fs_read::FsRead =

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ use crate::cli::chat::tools::execute::ExecuteCommand;
7777
use crate::cli::chat::tools::fs_read::FsRead;
7878
use crate::cli::chat::tools::fs_write::FsWrite;
7979
use crate::cli::chat::tools::gh_issue::GhIssue;
80-
use crate::cli::chat::tools::context::Context;
8180
use crate::cli::chat::tools::resource::Resource;
8281
use crate::cli::chat::tools::thinking::Thinking;
8382
use crate::cli::chat::tools::use_aws::UseAws;
@@ -908,8 +907,8 @@ impl ToolManager {
908907
if !crate::cli::chat::tools::thinking::Thinking::is_enabled(os) {
909908
tool_specs.remove("thinking");
910909
}
911-
if !crate::cli::chat::tools::context::Context::is_enabled(os) {
912-
tool_specs.remove("context");
910+
if !crate::cli::chat::tools::resource::Resource::is_enabled(os) {
911+
tool_specs.remove("resource");
913912
}
914913

915914
#[cfg(windows)]
@@ -1066,7 +1065,6 @@ impl ToolManager {
10661065
"use_aws" => Tool::UseAws(serde_json::from_value::<UseAws>(value.args).map_err(map_err)?),
10671066
"report_issue" => Tool::GhIssue(serde_json::from_value::<GhIssue>(value.args).map_err(map_err)?),
10681067
"thinking" => Tool::Thinking(serde_json::from_value::<Thinking>(value.args).map_err(map_err)?),
1069-
"context" => Tool::Context(serde_json::from_value::<Context>(value.args).map_err(map_err)?),
10701068
"resource" => Tool::Resource(serde_json::from_value::<Resource>(value.args).map_err(map_err)?),
10711069
// Note that this name is namespaced with server_name{DELIMITER}tool_name
10721070
name => {

0 commit comments

Comments
 (0)