Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: show attempt-completion in /tools for all agents#1545

Merged
tusharmath merged 2 commits into
mainfrom
add-attempt-completion
Sep 13, 2025
Merged

fix: show attempt-completion in /tools for all agents#1545
tusharmath merged 2 commits into
mainfrom
add-attempt-completion

Conversation

@tusharmath

@tusharmath tusharmath commented Sep 13, 2025

Copy link
Copy Markdown
Collaborator

fixes #1539

@github-actions github-actions Bot added the type: fix Iterations on existing features or infrastructure. label Sep 13, 2025
@openhands-ai

openhands-ai Bot commented Sep 13, 2025

Copy link
Copy Markdown

Looks like there are a few issues preventing this PR from being merged!

  • GitHub Actions are failing:
    • ci

If you'd like me to help, just leave a comment, like

@OpenHands please fix the failing actions on PR #1545 at branch `add-attempt-completion`

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());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Fix in Graphite


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()),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
false => Some(ToolUsagePrompt::from(&self.tool_definitions).to_string()),
false => Some(ToolUsagePrompt::from(&self.get_allowed_tools()).to_string()),

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@tusharmath tusharmath force-pushed the add-attempt-completion branch from 8e39458 to 75502a5 Compare September 13, 2025 04:43
@tusharmath tusharmath enabled auto-merge (squash) September 13, 2025 04:43
@tusharmath tusharmath merged commit 7bf0d84 into main Sep 13, 2025
8 checks passed
@tusharmath tusharmath deleted the add-attempt-completion branch September 13, 2025 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Iterations on existing features or infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: attempt_completion not listed in /tools and not defined in forge.md but added to System Prompt

1 participant