refactor(tools): move tool descriptions to jinja templates#2177
refactor(tools): move tool descriptions to jinja templates#2177nikhilk7153 wants to merge 10 commits intoOpenHands:mainfrom
Conversation
Move tool definition description text into packaged .j2 files and render them at tool creation time to simplify maintenance while preserving runtime behavior. Co-authored-by: Cursor <cursoragent@cursor.com>
Include new tool .j2 template paths in the PyInstaller spec so agent-server binaries can load tool descriptions at runtime. Co-authored-by: Cursor <cursoragent@cursor.com>
|
[Automatic Post]: I have assigned @enyst as a reviewer based on git blame information. Thanks in advance for the help! |
|
[Automatic Post]: This PR seems to be currently waiting for review. @enyst, could you please take a look when you have a chance? |
|
@OpenHands Read the linked issue and understand this PR. Then, choose an example or two to run, which contain tools, from the examples/ directory, and run them, to see if they work normally. You can use openai key and gpt-5-nano, I think, just a small llm for testing. Then, once you are done, do a /codereview too, and publish it with your feedback (not a comment, you are allowed to review). Include the results. |
|
I'm on it! enyst can track my progress at all-hands.dev |
enyst
left a comment
There was a problem hiding this comment.
Review summary
No blocking issues found. The template extraction and render-time description wiring look consistent across tools, and packaging updates include new templates.
Testing
- LLM_API_KEY=$OPENAI_API_KEY LLM_MODEL=openai/gpt-5-nano uv run python examples/01_standalone_sdk/02_custom_tools.py
- LLM_API_KEY=$OPENAI_API_KEY LLM_MODEL=openai/gpt-5-nano uv run python examples/01_standalone_sdk/41_task_tool_set.py
Notes
- This PR changes prompt/tool description text. Per repo guidance, please add the
integration-testlabel (or run the integration suite) to validate eval behavior.
This comment was marked as duplicate.
This comment was marked as duplicate.
Co-authored-by: openhands <openhands@all-hands.dev>
|
Tool description comparison results are now checked in under
Summary of detected text changes (main → PR):
If you want me to normalize whitespace to verify semantic equivalence, I can do that too. |
Co-authored-by: openhands <openhands@all-hands.dev>
|
Re-ran the main vs PR tool-description comparison after fixes. Results:
Commands executed (see
|
openhands-tools/openhands/tools/planning_file_editor/templates/tool_description.j2
Outdated
Show resolved
Hide resolved
b52b6da to
7e66c20
Compare
|
@OpenHands remove the entire .pr/ directory, it was temporary just for online testing of the PR. Push to branch; note that it's from a fork so make sure to set the remote properly. |
|
I'm on it! enyst can track my progress at all-hands.dev |
Co-authored-by: openhands <openhands@all-hands.dev>
|
Final summary:
The request has been fully addressed, and there are no extraneous code changes beyond removing the temporary |
|
[Automatic Post]: It has been a while since there was any activity on this PR. @nikhilk7153, are you still working on it? If so, please go ahead, if not then please request review, close it, or request that someone else follow up. |
Fix #2129
Summary
.j2templates acrossopenhands-tools