feat: add streaming option to provider config to support non-streaming backends#15931
Open
75ACOL wants to merge 1 commit intoanomalyco:devfrom
Open
feat: add streaming option to provider config to support non-streaming backends#1593175ACOL wants to merge 1 commit intoanomalyco:devfrom
75ACOL wants to merge 1 commit intoanomalyco:devfrom
Conversation
…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
}
}
}
}
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate FoundPR #14786 - "feat: add streaming option to provider config to support non-streaming backends" Why it's related: This appears to be a previous attempt at the exact same feature. According to the current PR description, PR #15931 is "a clean re-submission of the Recommendation: Verify that PR #14786 is closed/superseded and that PR #15931 is the current/correct implementation to proceed with. |
Author
6 tasks
IgorTavcar
added a commit
to IgorTavcar/opencode
that referenced
this pull request
Mar 4, 2026
…nds (anomalyco#15931) Cherry-picked from upstream PR anomalyco#15931. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Issue for this PR
Closes #785
Supersedes #14786
Type of change
What does this PR do?
streamingboolean option to provider configuration (provider.<id>.options.streaming)streaming: false, uses AI SDKsimulateStreamingMiddleware()so non-streaming backends can still work with OpenCode's streaming pipelinestreamingdefaults to enabled)How did you verify your code works?
packages/opencodeChecklist
Usage
{ "provider": { "my-backend": { "options": { "streaming": false } } } }Notes
disable streamingfeature on top of latestdev.