fix(responses): preserve function calls completed in done events - #2057
Open
MrLiuGangQiang wants to merge 6 commits into
Open
fix(responses): preserve function calls completed in done events#2057MrLiuGangQiang wants to merge 6 commits into
MrLiuGangQiang wants to merge 6 commits into
Conversation
Contributor
Greptile SummaryThis PR preserves completed function calls during OpenAI Responses stream conversion. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (6): Last reviewed commit: "test(responses): preserve tool identity ..." | Re-trigger Greptile |
Author
|
主要是为了解决codex使用子agent报错的问题 |
MrLiuGangQiang
added a commit
to MrLiuGangQiang/axonhub
that referenced
this pull request
Jul 28, 2026
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
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
Fixes an OpenAI Responses streaming conversion issue where a function call completed by
response.function_call_arguments.donecan lose its arguments or tool identity before it reaches the client.This affects upstreams that provide arguments,
name,namespace, orcall_idonly in a later event. In Codex, that can leavecollaboration.spawn_agentwithout a dispatchable identity even when the downstream response is valid.Root cause
The outbound transformer previously treated
response.function_call_arguments.doneas state-only. The inbound transformer also emittedresponse.output_item.addedimmediately, even when the function name was absent. A later terminal event could repair the final item, but it could not repair the already-emitted initial item that clients use to route the call.Changes
Outbound Responses transformer
call_id, with anitem_idtocall_idfallback.nameornamespacearrives after all arguments have already streamed.id,type,name, andnamespacein emitted tool-call deltas.Inbound Responses transformer
output_item.addedfor unnamed function calls until a tool name is available.output_item.added.call_id,name,namespace, and arguments in terminalresponse.function_call_arguments.doneandresponse.output_item.doneevents.JSON comparison safety
Semantically equivalent JSON that differs only in whitespace or object-key order is accepted without a duplicate delta. Comparisons use
json.Decoder.UseNumber(), preserving numeric lexemes so distinct large integers cannot collapse throughfloat64conversion.Regression coverage
function_call_arguments.done.9007199254740992and9007199254740993) rejected as a mismatch.spawn_agent,collaboration, call ID, and JSON arguments.output_item.addedis emitted.Verification