OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

[Bug]: In-context example does not match tool specification

Open yueqis opened this issue 8 months ago • 3 comments

Is there an existing issue for the same bug? (If one exists, thumbs up or comment on the issue instead).

  • [x] I have checked the existing issues.

Describe the bug and reproduction steps

The finish tool in codeact_agent requires two parameters ['message', 'task_completed'], but the in context example here does not include these two parameters.

Maybe the in context example here should be changed to:

ASSISTANT:
<function=finish>
<parameter=message>
The server is running on port 5000 with PID 126. You can access the list of numbers in a table format by visiting http://127.0.0.1:5000. Let me know if you have any further requests!
</parameter>
<parameter=task_completed>true</parameter>
</function>

OpenHands Installation

Docker command in README

OpenHands Version

No response

Operating System

None

Logs, Errors, Screenshots, and Additional Context

No response

yueqis avatar May 13 '25 14:05 yueqis

@openhands please fix this

neubig avatar May 13 '25 17:05 neubig

I'm on it! neubig can track my progress at all-hands.dev

openhands-ai[bot] avatar May 13 '25 17:05 openhands-ai[bot]

I successfully fixed issue #8476 in the OpenHands repository. Here's a summary of what I did:

  1. Issue Analysis: The issue was that the in-context example for the finish tool in fn_call_converter.py was missing the required parameters (message and task_completed) that are specified in the tool's definition in finish.py.

  2. Fix Implementation: I updated the in-context example in fn_call_converter.py to include both required parameters:

    • Added the message parameter containing the text that was previously outside the function call
    • Added the task_completed parameter with value "true"
  3. Testing: I ran the unit tests for the function call converter, which all passed, confirming that my changes didn't break any existing functionality.

  4. Code Quality: I ran the pre-commit hooks to ensure my changes met the code quality standards of the project.

  5. Pull Request: I created a new branch openhands/fix-finish-tool-example, committed my changes, and opened PR #8487 that fixes issue #8476.

The PR is now available at: https://github.com/All-Hands-AI/OpenHands/pull/8487

This change ensures that the in-context example correctly demonstrates how to use the finish tool with all its required parameters, which will help prevent confusion for developers and ensure proper function calling behavior.

openhands-ai[bot] avatar May 13 '25 17:05 openhands-ai[bot]

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jun 23 '25 02:06 github-actions[bot]

This issue was closed because it has been stalled for over 30 days with no activity.

github-actions[bot] avatar Jun 30 '25 02:06 github-actions[bot]