Skip to content

Commit 62732c6

Browse files
echobtfactorydroid
andauthored
fix(cortex-engine): align tool handler names with registry expectations (#237)
The ToolHandler::name() method for several handlers returned incorrect values, causing 'Tool not implemented' errors when the registry looked up handlers by name: - LocalShellHandler: 'Shell' -> 'Execute' (registered as 'Execute') - GrepHandler: 'Search' -> 'Grep' (registered as 'Grep') - GlobHandler: 'Find' -> 'Glob' (registered as 'Glob') - FetchUrlHandler: 'Fetch' -> 'FetchUrl' (registered as 'FetchUrl') The handler names must match the keys used in the handlers HashMap for proper dispatch in ToolRegistry::execute_with_context(). Co-authored-by: Droid Agent <droid@factory.ai>
1 parent 8c1aa9d commit 62732c6

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

cortex-engine/src/tools/handlers/fetch_url.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ impl Default for FetchUrlHandler {
147147
#[async_trait]
148148
impl ToolHandler for FetchUrlHandler {
149149
fn name(&self) -> &str {
150-
"Fetch"
150+
"FetchUrl"
151151
}
152152

153153
async fn execute(&self, arguments: Value, _context: &ToolContext) -> Result<ToolResult> {
@@ -196,7 +196,7 @@ mod tests {
196196
#[test]
197197
fn test_handler_creation() {
198198
let handler = FetchUrlHandler::new();
199-
assert_eq!(handler.name(), "Fetch");
199+
assert_eq!(handler.name(), "FetchUrl");
200200
}
201201

202202
#[test]

cortex-engine/src/tools/handlers/glob.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ impl Default for GlobHandler {
3636
#[async_trait]
3737
impl ToolHandler for GlobHandler {
3838
fn name(&self) -> &str {
39-
"Find"
39+
"Glob"
4040
}
4141

4242
async fn execute(&self, arguments: Value, context: &ToolContext) -> Result<ToolResult> {

cortex-engine/src/tools/handlers/grep.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl Default for GrepHandler {
5959
#[async_trait]
6060
impl ToolHandler for GrepHandler {
6161
fn name(&self) -> &str {
62-
"Search"
62+
"Grep"
6363
}
6464

6565
async fn execute(&self, arguments: Value, context: &ToolContext) -> Result<ToolResult> {

cortex-engine/src/tools/handlers/local_shell.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl Default for LocalShellHandler {
9999
#[async_trait]
100100
impl ToolHandler for LocalShellHandler {
101101
fn name(&self) -> &str {
102-
"Shell"
102+
"Execute"
103103
}
104104

105105
async fn execute(&self, arguments: Value, context: &ToolContext) -> Result<ToolResult> {

0 commit comments

Comments
 (0)