Skip to content

Allow custom openai-responses providers to opt into streaming #2040

Open

Description

@mortang2410

Problem

Custom providers can select the openai-responses protocol, but there is no configuration-only way to make those providers stream. The Responses client drops extra_body.stream, and streaming is currently enabled only for a built-in preset. Gateway-side buffering and using a patched installed binary are not acceptable fixes because they do not give users a supported per-provider setting.

Proposed change

Add a boolean requires_streaming field to custom provider entries. When a custom entry sets the field and resolves to openai-responses, the Responses client sends stream: true. Built-in presets ignore the field. Custom providers that omit the field keep non-streaming behavior, and the Chat Completions path is unchanged.

Evidence from the implementation and review

The change is implemented and reviewed on a fork. The pushed commits are:

Verification covered the resolver, the client request body, and the public JSON key. Focused resolver and client tests pass with all opt-in, opt-out and preset cases. The full Go package tests and go vet pass. 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 all seven valid 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; no further reviewer round was dispatched.

Scope note

No built-in preset behavior changes. No Chat Completions behavior changes. The field is opt-in and defaults to false.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions