Repository navigation
Description
Version / branch / commit
Reproduced against main at commit 16ccd787, using a local regression test.
OS and environment
macOS arm64; ChatGPT/Codex Responses provider.
Steps to reproduce
Feed the Codex streaming response handler a synthetic tool call sequence:
- Send
response.output_item.addedfor a function call, with empty arguments. - Do not send incremental argument events.
- Send
response.output_item.donefor the same call, containing complete arguments such as{"path":"README.md"}. - Observe the argument deltas delivered to the runtime before the tool-call-end event.
The same behavior occurs for custom/freeform tool input and when the added event is absent.
Expected behavior
When the final output-item event is the only event containing tool input, the provider forwards that input to the runtime before ending the tool call. Input already delivered through incremental events must not be duplicated.
Actual behavior
The provider retains the final input for history replay but does not emit an argument delta to the runtime. Tool execution can consequently receive an empty argument string, even though the final event contained valid input.
This can produce errors such as:
Invalid arguments for read_file: path is required
Invalid arguments for grep: pattern is required
Relevant evidence and regression coverage
Affected code: internal/providers/openai/codex_responses.go, handling response.output_item.done.
A locally prepared regression test, TestCodexOutputItemDoneForwardsUnstreamedArguments, covers eight combinations: function/custom calls, added event present/absent, and streamed/final-only input. Using an overlay with the unmodified production file from HEAD, all four final-only cases fail, including:
arguments at tool-call-end = "", want "{\"path\":\"README.md\"}"
With a focused local fix that forwards final-only input before tool-call-end, all eight cases pass; the OpenAI provider package also passes with the race detector. The regression test and fix are local and not yet published. Full-repository validation has outstanding failures outside the provider package; this is not a claim that the full suite passes.
This demonstrates an argument-loss path, but does not establish that it caused the original user-session failures that prompted the investigation. No private session logs are included.
I can contribute the focused fix and regression coverage if maintainers approve this issue for community implementation. No PR has been opened.
Activity
Vasanthdev2004 commentedon Nov 7, 2026
Thanks, confirmed on main at 16ccd78. I drove the provider through
zeroruntime.CollectStream, which is what the runtime uses, and afunction_callwhose arguments arrive only onresponse.output_item.donecomes out with empty arguments, with or without the added event. Streamed arguments are fine.One more case belongs in the same fix: a
custom_tool_callwhose input is already onresponse.output_item.added.handleOutputItemAddedwrites it into the builder without sending a delta, and the done handler then skips the final input because the builder is no longer empty, so the runtime gets nothing there either. So the check for what still needs forwarding should track what was actually sent to the runtime, notbuilder.Arguments.Len().Labelled and assigned to you, go ahead with the PR. Please put a closing keyword for this issue in the description so it closes on merge.
fix(codex): forward tool input that only arrives whole on an output i…