Skip to content

fix: handle response.incomplete when streaming - #23

Merged
TheGreatAxios merged 1 commit into
cl-9423-openai-responses-keep-function-calls-when-reasoning-cant-befrom
cl-9424-openai-responses-handle-responseincomplete-in-the-streaming
Sep 27, 2026
Merged

TheGreatAxios merged 1 commit into
cl-9423-openai-responses-keep-function-calls-when-reasoning-cant-befrom
cl-9424-openai-responses-handle-responseincomplete-in-the-streaming

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Closes CL-9424

Summary

  • A streamed response.incomplete event (for example max_output_tokens or a content filter) used to fall through to the default case, so the turn finished as if it had succeeded.
  • It now throws a ProtocolMismatchError with the incomplete_details reason, as parseJSONResponse does for status incomplete. runInference turns it into a protocol_mismatch inference.error.
  • Usage from that event is not reported. @intx/inference 0.4's harness drops the events of a parseResponse call that throws, ignores inference.error events from adapters, and has no end-of-stream hook, so an adapter can't emit usage and fail on the same event.
  • New e2e test streams response.incomplete through runInference and asserts a protocol_mismatch error containing the reason and no inference.done.

Checks

bun run check, bun run build, bun run test:e2e and the Node pack smoke pass locally.

@TheGreatAxios
TheGreatAxios added this pull request to stack #19 September 27, 2026 00:19
@TheGreatAxios
TheGreatAxios merged commit 8004b49 into main Sep 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant