1+ import { canonicalToolName } from "./canonical-tool-name.js" ;
12import {
23 DefaultDirector ,
34 type ExtendedInferenceOptions ,
@@ -446,7 +447,7 @@ function applyManageTasksToolCall(
446447 tasks : Task [ ] ,
447448 block : { name : string ; arguments : unknown } ,
448449) : Task [ ] | null {
449- if ( block . name !== "manage_tasks" ) return null ;
450+ if ( canonicalToolName ( block . name ) !== "manage_tasks" ) return null ;
450451 const taskArgs = parseManageTasksArgs ( block . arguments ) ;
451452 return taskArgs !== null ? applyManageTasks ( tasks , taskArgs ) : null ;
452453}
@@ -1173,7 +1174,8 @@ class ChatDirectorImpl extends DefaultDirector {
11731174 }
11741175 for ( const block of event . turn . content ) {
11751176 if ( block . type !== "tool_call" ) continue ;
1176- if ( block . name === "manage_tasks" ) {
1177+ const engineName = canonicalToolName ( block . name ) ;
1178+ if ( engineName === "manage_tasks" ) {
11771179 const next = applyManageTasksToolCall ( this . tasks , block ) ;
11781180 if ( next !== null ) {
11791181 this . tasks = next ;
@@ -1183,7 +1185,7 @@ class ChatDirectorImpl extends DefaultDirector {
11831185 } ) ,
11841186 ) ;
11851187 }
1186- } else if ( block . name === "read_file" || block . name === "edit_file" ) {
1188+ } else if ( engineName === "read_file" || engineName === "edit_file" ) {
11871189 const pathResult = PathArgSchema ( block . arguments ) ;
11881190 const path = pathResult instanceof type . errors ? "" : pathResult . path ;
11891191 if ( isCodeFile ( path ) ) this . lspTriggerCalls . add ( block . id ) ;
@@ -1194,7 +1196,7 @@ class ChatDirectorImpl extends DefaultDirector {
11941196 args : block . arguments ,
11951197 } ) ;
11961198 }
1197- if ( block . name === "ask_operator" ) {
1199+ if ( engineName === "ask_operator" ) {
11981200 this . askOperatorCalls . add ( block . id ) ;
11991201 }
12001202 }
0 commit comments