Skip to content

feat: add streaming option to provider config to support non-streamin…#14786

Open
poelzi wants to merge 1 commit intoanomalyco:devfrom
poelzi:feat/disable-streaming
Open

feat: add streaming option to provider config to support non-streamin…#14786
poelzi wants to merge 1 commit intoanomalyco:devfrom
poelzi:feat/disable-streaming

Conversation

@poelzi
Copy link

@poelzi poelzi commented Feb 23, 2026

Issue for this PR

Closes #785

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Add a 'streaming' boolean option to the provider configuration schema.
When set to false, the AI SDK's simulateStreamingMiddleware is used to make non-streaming (doGenerate) requests and convert the response into a simulated stream, allowing the rest of the processing pipeline to work unchanged.

Tested with CatGPT

How did you verify your code works?

Used it with CatGPT which does not support streaming. After this change it worked

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

…g backends

Add a 'streaming' boolean option to the provider configuration schema.
When set to false, the AI SDK's simulateStreamingMiddleware is used to
make non-streaming (doGenerate) requests and convert the response into
a simulated stream, allowing the rest of the processing pipeline to
work unchanged.

This is useful for custom OpenAI-compatible backends that do not
support server-sent events / streaming responses.

Usage in opencode.json:
  {
    "provider": {
      "myprovider": {
        "options": {
          "streaming": false
        }
      }
    }
  }
@github-actions github-actions bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Feb 23, 2026
@github-actions
Copy link
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@19h
Copy link

19h commented Feb 24, 2026

The failures seem to be due to flaky tests, not this PR.

@75ACOL
Copy link

75ACOL commented Mar 3, 2026

I opened a follow-up PR that includes this change and adds integration coverage for the non-streaming fallback path:

It includes:

  • provider.options.streaming support + simulateStreamingMiddleware() wiring
  • test coverage in packages/opencode/test/session/llm.test.ts for non-SSE JSON /chat/completions responses when streaming: false

@75ACOL
Copy link

75ACOL commented Mar 4, 2026

Maintainer note: this PR is superseded by #15931 (same feature, rebased on latest dev, checks currently green there). Please prefer #15931 for review/merge; this one can be closed as superseded.

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.

Is there a way to disable streaming mode?

3 participants