-
Notifications
You must be signed in to change notification settings - Fork 59
feat(tools): Add ApplyPatch tool (GPT-5.1 apply_patch) #1166
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
Draft
enyst
wants to merge
19
commits into
main
Choose a base branch
from
feat/apply-patch-tool-gpt5-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…tch format\n\n- Port reference parser/applicator into core module\n- Integrate as ToolDefinition with executor and safe workspace I/O\n- New example using openai/gpt-5.1-codex-mini to create/modify/delete FACTS.txt via tool\n\nCo-authored-by: openhands <[email protected]>
…1 example; keep reasoning_summary=None to avoid org verification Co-authored-by: openhands <[email protected]>
…example: run gpt-5.1-codex-mini end-to-end
- Override to_responses_tool() to return minimal {type:function, name}
- Add validation_alias/serialization_alias so server-sent 'patch' is accepted
- Update example to register ApplyPatch and run create/modify/delete FACTS.txt
Co-authored-by: openhands <[email protected]>
…ix example tool registration - Add AliasChoices to accept server arg name 'patch' - Provide minimal parameters in to_responses_tool to steer Responses tools - Example: remove register_default_tools; import classes to register Co-authored-by: openhands <[email protected]>
…input; send only tool outputs - Remove assistant function_call emission in Message.to_responses_dict - Stop passing back previous turn 'reasoning' items to avoid ordering errors - This aligns with OpenAI Responses pattern: client supplies only function_call_output Co-authored-by: openhands <[email protected]>
…assthrough - Keep assistant function_call in input so paired tool outputs validate - Do not echo prior 'reasoning' items to avoid ordering constraints Co-authored-by: openhands <[email protected]>
- Capture design choices, telemetry observations, and pending items - Reference PR #1166 and branch name for continuity Co-authored-by: openhands <[email protected]>
…tant function_call in input - Reinstate reasoning passthrough to satisfy existing unit tests - Keep assistant function_call items and pair with tool outputs in same request Co-authored-by: openhands <[email protected]>
Contributor
Coverage Report •
|
|||||||||||||||||||||||||||||||||||
…_output ids - Fix imports and formatting for pre-commit Co-authored-by: openhands <[email protected]>
…esponses notes - FileEditor example mirrors ApplyPatch for log comparison - Notes: restore reasoning passthrough; pair assistant calls with tool outputs Co-authored-by: openhands <[email protected]>
…t; fix pairing error. Telemetry: trim system instructions from logs and compact tool metadata for readability. Co-authored-by: openhands <[email protected]>
9a9234e to
e910dbf
Compare
… rejection.\n\nAligned expected newline behavior with upstream apply_patch (no enforced trailing newline).\n\nCo-authored-by: openhands <[email protected]>
…le and status update. Co-authored-by: openhands <[email protected]>
17d2380 to
e772cbb
Compare
Co-authored-by: openhands <[email protected]>
…ross action and executor. - Update tests to pass 'patch' field - Keep Responses tool schema minimal with required 'patch' Co-authored-by: openhands <[email protected]>
… mention of 'patch_text'. Co-authored-by: openhands <[email protected]>
…y diff). Co-authored-by: openhands <[email protected]>
…via Tool(name="apply_patch"). Co-authored-by: openhands <[email protected]>
…d clarify Responses schema. Co-authored-by: openhands <[email protected]>
|
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Design notes
Usage
uv run python examples/01_standalone_sdk/28_apply_patch_with_gpt5_1.py
Responses API/tool-calling
Testing performed
Next steps
Co-authored-by: openhands [email protected]
@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:1b9eb96-pythonRun
All tags pushed for this build
About Multi-Architecture Support
1b9eb96-python) is a multi-arch manifest supporting both amd64 and arm641b9eb96-python-amd64) are also available if needed