fix: show attempt-completion in /tools for all agents#1545
Conversation
|
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
|
|
||
| // Reset all the available tools | ||
| context = context.tools(self.get_allowed_tools()?); | ||
| context = context.tools(self.tool_definitions.clone()); |
There was a problem hiding this comment.
Critical bug: The orchestrator now passes self.tool_definitions.clone() to the context, but this no longer includes the AttemptCompletion tool definition. The removed get_allowed_tools() method was responsible for adding the AttemptCompletion tool definition to the list. Without this, the LLM context will be missing the AttemptCompletion tool definition, even though agents are configured to use it, causing tool call failures when agents attempt to use AttemptCompletion.
| context = context.tools(self.tool_definitions.clone()); | |
| let mut tools = self.tool_definitions.clone(); | |
| tools.push(AttemptCompletion::tool_definition()); | |
| context = context.tools(tools); |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
| let tool_information = match tool_supported { | ||
| true => None, | ||
| false => Some(ToolUsagePrompt::from(&self.get_allowed_tools()?).to_string()), | ||
| false => Some(ToolUsagePrompt::from(&self.tool_definitions).to_string()), |
There was a problem hiding this comment.
Critical bug: Similar to line 275, this line now uses &self.tool_definitions for the ToolUsagePrompt, but this no longer includes the AttemptCompletion tool definition that was previously added by get_allowed_tools(). This will result in incomplete tool usage prompts that don't mention the AttemptCompletion tool, potentially confusing the LLM about available tools.
| false => Some(ToolUsagePrompt::from(&self.tool_definitions).to_string()), | |
| false => Some(ToolUsagePrompt::from(&self.get_allowed_tools()).to_string()), |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
8e39458 to
75502a5
Compare
fixes #1539