File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
crates/chat-cli/src/cli/chat Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -306,12 +306,11 @@ impl ConversationState {
306306 // do this if the last message is a tool call that has failed.
307307 let tool_use_results = user_msg. tool_use_results ( ) ;
308308 if let Some ( tool_use_results) = tool_use_results {
309- let tool_name_list = self
310- . tools
311- . values ( )
312- . flatten ( )
313- . map ( |Tool :: ToolSpecification ( spec) | spec. name . as_str ( ) )
314- . collect :: < Vec < _ > > ( ) ;
309+ // Note that we need to use the keys in tool manager's tn_map as the keys are the
310+ // actual tool names as exposed to the model and the backend. If we use the actual
311+ // names as they are recognized by their respective servers, we risk concluding
312+ // with false positives.
313+ let tool_name_list = self . tool_manager . tn_map . keys ( ) . map ( String :: as_str) . collect :: < Vec < _ > > ( ) ;
315314 for result in tool_use_results {
316315 if let ToolResultStatus :: Error = result. status {
317316 let tool_use_id = result. tool_use_id . as_str ( ) ;
You can’t perform that action at this time.
0 commit comments