Skip to content

fix: always set stream parameter in OpenAI-compatible requests#1511

Open
alexcani-philips wants to merge 1 commit into
sigoden:mainfrom
alexcani-philips:alexcani/fix-stream-parameter
Open

fix: always set stream parameter in OpenAI-compatible requests#1511
alexcani-philips wants to merge 1 commit into
sigoden:mainfrom
alexcani-philips:alexcani/fix-stream-parameter

Conversation

@alexcani-philips

Copy link
Copy Markdown

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.

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
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