-
Notifications
You must be signed in to change notification settings - Fork 95
Add GPT-5 preset using ApplyPatchTool (opt-in) #1462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ult) - Introduce preset.gpt5 with register/get tools & get_gpt5_agent - Mirrors Gemini preset pattern; does not change global defaults Co-authored-by: openhands <openhands@all-hands.dev>
- Demonstrates opt-in preset via get_gpt5_agent - Mirrors Gemini example style Co-authored-by: openhands <openhands@all-hands.dev>
|
(Agent) Summary of new changes and validation
Running the example
Run the example with your OpenAI key: Executed locally; succeeded. Done. |
| "two short lines describing this repository." | ||
| ) | ||
| conversation.run() | ||
| print("All done!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@OpenHands Both this preset example, and the Gemini example in examples/ , fail test-examples workflow because they don't print, idk, something at the end like other examples. Figure it out and fix it.
Also, make sure that both this file and the gemini example file are named correctly, that is, as you can see in their directory, they all increase numbering in the file names. Commit and push to branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm on it! enyst can track my progress at all-hands.dev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've fixed the test-examples workflow failures and corrected the file numbering. Here's a summary of the changes:
Changes Made
✅ Fixed EXAMPLE_COST marker issue
Both examples were failing the test-examples workflow because they didn't print the required EXAMPLE_COST: {cost} marker at the end. The test framework checks for this marker to track costs.
- 33_gemini_file_tools.py: Added
EXAMPLE_COSTmarker - 34_gpt5_apply_patch_preset.py: Added
EXAMPLE_COSTmarker
✅ Corrected file numbering
The examples directory had files numbered 30, 31, 32, then jumped to 35. Fixed to be sequential:
- Renamed
35_gpt5_apply_patch_preset.py→34_gpt5_apply_patch_preset.py - Added
33_gemini_file_tools.py(new file)
✅ Added missing gemini tools and preset
The gemini example required the gemini tools module which was missing from this branch. Added from main:
openhands-tools/openhands/tools/gemini/(entire module)openhands-tools/openhands/tools/preset/gemini.py- Updated
openhands-tools/openhands/tools/preset/__init__.pyto export gemini preset functions
Commit pushed to branch
The changes have been committed and pushed to feat/preset-gpt5-apply-patch-from-main.
- Add gemini tools and preset from main branch - Add 33_gemini_file_tools.py example with EXAMPLE_COST marker - Rename 35_gpt5_apply_patch_preset.py to 34_gpt5_apply_patch_preset.py - Add EXAMPLE_COST marker to GPT5 example - Update preset __init__.py to export gemini preset functions Co-authored-by: openhands <openhands@all-hands.dev>
Resolve conflict in preset __init__.py by keeping both gemini and gpt5 exports. Co-authored-by: openhands <openhands@all-hands.dev>
- Add EXAMPLE_COST marker to 30_gemini_file_tools.py (from main) - Remove duplicate 33_gemini_file_tools.py - Rename GPT5 example from 34 to 33 (sequential numbering) Co-authored-by: openhands <openhands@all-hands.dev>
30_tom_agent.py already exists, so rename 30_gemini_file_tools.py to 34. Co-authored-by: openhands <openhands@all-hands.dev>
- Move GPT-5 apply patch preset example to 04_llm_specific_tools/01_gpt5_apply_patch_preset.py - Move Gemini file tools example to 04_llm_specific_tools/02_gemini_file_tools.py - Update usage path in docstring This organizes LLM-specific tool examples into a dedicated folder as suggested in PR #1486 review. Co-authored-by: openhands <openhands@all-hands.dev>
|
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 |
HUMAN: I reviewed the code, and I confirm the agent ran the example and it did create the file with the correct contents.
Summary
This PR introduces a GPT-5 preset that uses ApplyPatchTool for file edits, mirroring the pattern in the Gemini tools PR (#1199). It is an optional preset (get_gpt5_agent / get_gpt5_tools) and does not change global defaults or the standard preset behavior.
Rationale
Changes
What this PR does NOT do
Usage
Python (explicit preset):
Or get tools only:
Backward compatibility
Testing & Quality
Relationship to other PRs
Co-authored-by: openhands openhands@all-hands.dev
@enyst can click here to continue refining the PR
Agent Server images for this PR
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdknikolaik/python-nodejs:python3.12-nodejs22golang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:6b301b0-pythonRun
All tags pushed for this build
About Multi-Architecture Support
6b301b0-python) is a multi-arch manifest supporting both amd64 and arm646b301b0-python-amd64) are also available if needed