Skip to content

feat: add streaming option to provider config to support non-streaming backends#15931

Open
75ACOL wants to merge 1 commit intoanomalyco:devfrom
75ACOL:codex/resubmit-disable-streaming-14719
Open

feat: add streaming option to provider config to support non-streaming backends#15931
75ACOL wants to merge 1 commit intoanomalyco:devfrom
75ACOL:codex/resubmit-disable-streaming-14719

Conversation

@75ACOL
Copy link

@75ACOL 75ACOL commented Mar 4, 2026

Issue for this PR

Closes #785
Supersedes #14786

Type of change

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

What does this PR do?

  • Adds a streaming boolean option to provider configuration (provider.<id>.options.streaming)
  • When streaming: false, uses AI SDK simulateStreamingMiddleware() so non-streaming backends can still work with OpenCode's streaming pipeline
  • Keeps default behavior unchanged (streaming defaults to enabled)

How did you verify your code works?

  • Verified with local typecheck for packages/opencode

Checklist

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

Usage

{
  "provider": {
    "my-backend": {
      "options": {
        "streaming": false
      }
    }
  }
}

Notes

…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
Copy link
Contributor

github-actions bot commented Mar 4, 2026

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate Found

PR #14786 - "feat: add streaming option to provider config to support non-streaming backends"
#14786

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 disable streaming feature on top of latest dev" that supersedes earlier attempts. PR #14786 has a nearly identical title and addresses the same functionality.

Recommendation: Verify that PR #14786 is closed/superseded and that PR #15931 is the current/correct implementation to proceed with.

@75ACOL
Copy link
Author

75ACOL commented Mar 4, 2026

Thanks for flagging. This PR is intentionally a re-submission of the same feature and supersedes #14786.

Reason: the previous PR was based on an older head and hit flaky CI; this one is rebased on latest dev and contains the same scoped change.

For review/merge, please use #15931 as the active PR.

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

2 participants