Skip to content

Add requires_streaming opt-in for custom Responses providers - #2041

Open
mortang2410 wants to merge 3 commits into
alibaba:mainfrom
scratchspace-mortang:main
Open

mortang2410 wants to merge 3 commits into
alibaba:mainfrom
scratchspace-mortang:main

Conversation

@mortang2410

Copy link
Copy Markdown

Summary

Adds requires_streaming to custom provider entries so a custom openai-responses provider can opt into SSE streaming. Built-in presets ignore the field, custom providers that omit it stay non-streaming, and the Chat Completions path is unchanged.

Closes #2040

Changes

  • Resolver carries the opt-in from custom provider configuration into the resolved endpoint only for custom entries.
  • Responses client sends stream: true when the resolved endpoint requires streaming.
  • Tests use raw JSON fixtures so the public key spelling is pinned, cover both opt-in directions, restore the resolved protocol assertion, add a case proving extra_body.stream is not a second opt-in, and assert the resolved flag for every client case instead of keying off a subtest name.

Verification

  • Focused resolver and client tests pass with all opt-in, opt-out, second-flag and preset cases.
  • go test ./internal/llm/... ./cmd/opencodereview/... passes.
  • go vet ./... passes.
  • Static scan reports no complexity or parser failures.
  • Named mutants fail for a changed JSON tag, a wrong resolved protocol, treating extra_body.stream as a second opt-in, and leaking the field into a built-in preset.

Review closure

The code review confirmed and fixed seven findings across two rounds. One finding was rejected on scope because the settled requirements do not require rejecting the field on a non-Responses custom provider. The final round repeated the test-sensitivity and corpus-gap class from the first round, so the repeated-class gate stopped the loop. No open finding remains and no further reviewer round was dispatched.

Commits

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


mortang2410 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions

Copy link
Copy Markdown
Contributor

✅ OpenCodeReview: Review complete: 0 finding(s) across 3 selected item(s).

This branch has not been deployed

No deployments
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.

Allow custom openai-responses providers to opt into streaming

2 participants