fix: always set stream parameter in OpenAI-compatible requests#1511
Open
alexcani-philips wants to merge 1 commit into
Open
fix: always set stream parameter in OpenAI-compatible requests#1511alexcani-philips wants to merge 1 commit into
alexcani-philips wants to merge 1 commit into
Conversation
Previously, the stream parameter was only set to true when streaming was enabled, but omitted entirely when disabled. This could cause some OpenAI-compatible APIs to default to unexpected behavior. Now the parameter is always explicitly set to the correct boolean value.
ei-grad
added a commit
to ei-grad/aichat
that referenced
this pull request
Jul 11, 2026
Accumulate OpenAI tool calls across every delta entry and split reused indexes only when a new non-empty call ID arrives. Validate complete JSON arguments before dispatch and serialize the stream flag in both modes. Surface Claude SSE provider errors and numeric code/detail HTTP errors so failed requests cannot be treated as empty successful completions. Add deterministic regression fixtures for continuation chunks, call boundaries, parallel deltas, invalid JSON, and successful control streams. Reimplements fixes from: sigoden#1496 sigoden#1511 sigoden#1513 Co-Authored-By: Codex CLI <noreply@openai.com>
ei-grad
added a commit
to ei-grad/aichat
that referenced
this pull request
Jul 11, 2026
Treat transport EOF as truncation unless the provider handler confirms protocol completion. This prevents OpenAI tool calls from being flushed without [DONE] and keeps Claude tool_use blocks staged until a matching content_block_stop and the final message_stop. Track Claude block indexes so mismatched deltas and stops fail closed. Keep normal text, reasoning, provider errors, and Cohere's [DONE] completion path unchanged. Remediates the streaming review finding in integrations based on: sigoden#1496 sigoden#1511 sigoden#1513 Co-Authored-By: Codex CLI <noreply@openai.com>
ei-grad
added a commit
to ei-grad/aichat
that referenced
this pull request
Jul 11, 2026
Integrate the exact upstream PR head so OpenAI-compatible requests always carry the configured stream boolean. The combined streaming follow-up keeps this source hunk and adds focused true/false coverage. Source: sigoden#1511 Head: 63ecb71
ei-grad
added a commit
to ei-grad/aichat
that referenced
this pull request
Jul 11, 2026
Extend the imported OpenAI and Claude foundations with index-aware multi-call accumulation, complete JSON validation, deterministic request serialization, and provider-error controls. Preserve the exact PR commits in ancestry while replacing their incomplete accumulator and boundary behavior with the reviewed combined contract and focused tests. Sources: sigoden#1496 sigoden#1511 sigoden#1513 Reviewed behavior: 2dd73a2 Co-Authored-By: Codex CLI <noreply@openai.com>
ei-grad
added a commit
to ei-grad/aichat
that referenced
this pull request
Jul 11, 2026
Integrate the named provider-state branch after the exact sigoden#1496, sigoden#1511, and sigoden#1513 imports. The second parent records the reviewed multi-call, validation, and deterministic streaming test contract. Sources: sigoden#1496 sigoden#1511 sigoden#1513
ei-grad
added a commit
to ei-grad/aichat
that referenced
this pull request
Jul 11, 2026
Treat transport EOF as truncation unless the provider handler confirms protocol completion. This prevents OpenAI tool calls from being flushed without [DONE] and keeps Claude tool_use blocks staged until a matching content_block_stop and the final message_stop. Track Claude block indexes so mismatched deltas and stops fail closed. Keep normal text, reasoning, provider errors, and Cohere's [DONE] completion path unchanged. Remediates the streaming review finding in integrations based on: sigoden#1496 sigoden#1511 sigoden#1513 Co-Authored-By: Codex CLI <noreply@openai.com>
ei-grad
added a commit
to ei-grad/aichat
that referenced
this pull request
Jul 11, 2026
Integrate the named fail-closed completion branch after provider streaming and credential remediation. The second parent records OpenAI [DONE] and Claude block/message-stop requirements without dispatching pending side effects on transport EOF. Sources: sigoden#1496 sigoden#1511 sigoden#1513
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.
Previously, the stream parameter was only set to true when streaming was enabled, but omitted entirely when disabled. This could cause some OpenAI-compatible APIs to default to unexpected behavior. Now the parameter is always explicitly set to the correct boolean value.
Since the default value on OpenAI's API is already false, this should not affect OpenAI official models.