Summary
provider-openai has a recovery path that salvages non-completed streaming responses:
[PROVIDER] OpenAI recovered a non-completed streaming response (status=incomplete...): returning the partial response instead of failing.
(The warning references amplifier-support#339; that repo is not publicly resolvable, so this issue is filed here.)
When the salvaged partial response contains a function_call item, the salvage can leave that call unpaired (no function_call_output) in persisted conversation history. Because the Responses API requires every function_call item in replayed input to have a matching function_call_output, every subsequent request in the session fails — the session is permanently wedged and no retry can ever succeed.
Observed behavior
-
Model: gpt-5.6-sol, with enable_response_chaining: auto.
-
A chained continuation response (llm:response event with continuation_count: 1, output_tokens: 2050, cost_usd: null, 2026-08-01) ended non-completed and was salvaged by the recovery path.
-
The salvaged partial contained:
- A function call with truncated/empty arguments
{}, which failed tool schema validation ("Command is required").
- A
function_call item (call_NpD59KEhgybRvh2IyJ4AEWKF) that never received a function_call_output.
-
Every subsequent request in that session failed with:
InvalidRequestError: "No tool output found for function call call_NpD59KEhgybRvh2IyJ4AEWKF"
14 occurrences in the session log, including retries 7 hours later. Because the dangling function_call is persisted in history, retries can never succeed.
Note: the caps were NOT the cause
The request budget was max_output_tokens=128000 with a 900k context, and the turn was at ~110k input / 2k output. So the non-completed status was likely content_filter or a stream drop — but the warning text only guesses "max_output_tokens".
Proposed fix
When salvaging a non-completed response (especially mid-continuation):
- Drop
function_call items whose arguments are truncated/unparseable.
- Guarantee pairing: every retained
function_call must get an output — synthesize an error function_call_output (e.g. "call truncated by provider") for any salvaged call that tooling didn't execute.
- Log
incomplete_details.reason explicitly in the salvage warning instead of guessing at the cause.
Affected code
amplifier-module-provider-openai — the streaming recovery/salvage path and response chaining.
Summary
provider-openai has a recovery path that salvages non-
completedstreaming responses:(The warning references amplifier-support#339; that repo is not publicly resolvable, so this issue is filed here.)
When the salvaged partial response contains a
function_callitem, the salvage can leave that call unpaired (nofunction_call_output) in persisted conversation history. Because the Responses API requires everyfunction_callitem in replayed input to have a matchingfunction_call_output, every subsequent request in the session fails — the session is permanently wedged and no retry can ever succeed.Observed behavior
Model:
gpt-5.6-sol, withenable_response_chaining: auto.A chained continuation response (
llm:responseevent withcontinuation_count: 1,output_tokens: 2050,cost_usd: null, 2026-08-01) ended non-completedand was salvaged by the recovery path.The salvaged partial contained:
{}, which failed tool schema validation ("Command is required").function_callitem (call_NpD59KEhgybRvh2IyJ4AEWKF) that never received afunction_call_output.Every subsequent request in that session failed with:
14 occurrences in the session log, including retries 7 hours later. Because the dangling
function_callis persisted in history, retries can never succeed.Note: the caps were NOT the cause
The request budget was
max_output_tokens=128000with a 900k context, and the turn was at ~110k input / 2k output. So the non-completedstatus was likelycontent_filteror a stream drop — but the warning text only guesses "max_output_tokens".Proposed fix
When salvaging a non-
completedresponse (especially mid-continuation):function_callitems whose arguments are truncated/unparseable.function_callmust get an output — synthesize an errorfunction_call_output(e.g. "call truncated by provider") for any salvaged call that tooling didn't execute.incomplete_details.reasonexplicitly in the salvage warning instead of guessing at the cause.Affected code
amplifier-module-provider-openai— the streaming recovery/salvage path and response chaining.