Add GPT-5 preset using ApplyPatchTool (opt-in)#1462
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. |
- 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>
|
@OpenHands The CI job "[Optional] Docs example / check-examples" fails on this PR. That is expected, check for yourself why it fails and you will understand. But there's a second issue: we don't want the workflow to take into account the new directory So on this PR, please exclude that directory from the CI job. Write minimal code to exclude the examples in it. Then open an OpenHands/docs PR with the documentation for how to adapt the SDK to your desired LLM according to the comment. (do not use the expandable thing I think) |
|
I'm on it! enyst can track my progress at all-hands.dev |
…n- Update check_documented_examples.py to skip 04_llm_specific_tools\n- Update workflow paths filter to ignore that directory\n\nCo-authored-by: openhands <openhands@all-hands.dev>
- Gemini: explicitly list tools in docstring - GPT5: explicitly state ApplyPatch/unified-diff editing Co-authored-by: openhands <openhands@all-hands.dev>
🔄 Running Examples with
|
|
@OpenHands Why is the "run examples scripts / test-examples" job in CI in canceled status? Apparently it went for more an 1 hour. Check the logs and code and try to understand: why did it happen? You can install yourself |
|
I'm on it! enyst can track my progress at all-hands.dev |
|
Summary of findings
|
|
@OpenHands Run 33_hooks.py yourself after you build the project, and see what is it doing: make sure you use the litellm api key in your env, with base url https://llm-proxy.eval.all-hands.dev, and one of the models you find with v1/models, e.g. maybe a haiku model. Don't use an expensive model. Enable telemetry and log completions to logs/hooks/ so you see what happens. Be ready to stop the process if necessary, maybe use tmux to spawn it. |
|
I'm on it! enyst can track my progress at all-hands.dev |
|
Final summary What I changed
Why and how I validated
Checklist against your request
Git
If you want, I can switch models, adjust log directory, or keep the script running interactively in tmux for longer runs. |
978cf7e to
d27b0ff
Compare
|
@OpenHands look at the workflow run when we apply Try to use the "openhands llm api key" in your env to see what exact models are available with the prefix |
|
I'm on it! enyst can track my progress at all-hands.dev |
- Add _SPECIFIC_EXAMPLES map for examples/04_llm_specific_tools/* - Override LLM_MODEL per-example during pytest execution - Keep target directories unchanged so generic examples still run Co-authored-by: openhands <openhands@all-hands.dev>
|
Here’s a concise summary of what I changed and verified. What I changed
What I checked
Checklist against your request
Outcome
|
🔄 Running Examples with
|
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:6a806f4-pythonRun
All tags pushed for this build
About Multi-Architecture Support
6a806f4-python) is a multi-arch manifest supporting both amd64 and arm646a806f4-python-amd64) are also available if needed