Skip to content

Commit 17d2380

Browse files
committed
Docs: update ApplyPatch Responses notes with paired tool output example and status update.\n\nCo-authored-by: openhands <[email protected]>
1 parent 6cd9639 commit 17d2380

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

docs/dev/apply_patch_responses_notes.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ApplyPatch + OpenAI Responses Integration Notes
22

3-
Status: in progress
3+
Status: fixed and validated
44
Branch: feat/apply-patch-tool-gpt5-1
55
PR: https://github.com/OpenHands/software-agent-sdk/pull/1166
66

@@ -38,3 +38,25 @@ We integrated an ApplyPatch tool modeled after OpenAI's cookbook for GPT-5.1 "se
3838

3939
- Enable `log_completions=True` to inspect requests/responses under `logs/completions/`.
4040
- Compare call_id values across turns and ensure consistency.
41+
42+
## Minimal paired example (ApplyPatch)
43+
44+
The Responses input array for a successful ApplyPatch turn includes:
45+
- assistant function_call: name "apply_patch", arguments {"patch": "*** Begin Patch ... *** End Patch"}
46+
- tool function_call_output: call_id equal to the assistant function_call's call_id; output contains the observation text, e.g., "Done!"
47+
48+
Example (abridged):
49+
50+
[
51+
{"type": "function_call", "call_id": "fc_call_abc", "name": "apply_patch", "arguments": "{...}"},
52+
{"type": "function_call_output", "call_id": "fc_call_abc", "output": "Done!"}
53+
]
54+
55+
This pairing is required by OpenAI; otherwise, a 400 error is returned.
56+
57+
## FileEditor vs ApplyPatch
58+
59+
- Both tools now produce a text observation to ensure function_call_output is serialized.
60+
- ApplyPatch is a server-known tool; we advertise a minimal schema (only name and a minimal parameters stub) to nudge the model to pass a 'patch' field.
61+
- Telemetry now trims giant system instructions for readability and logs compact tool metadata.
62+

0 commit comments

Comments
 (0)