Skip to content

Claude streams in bursts via github-copilot provider, GPT streams smoothly #25172

Closed as not planned

Description

@jimicze

Claude models via the github-copilot provider stream in visible bursts — text arrives in chunks with pauses up to ~500-750ms between them. GPT models on the same provider stream continuously. Happens on every Claude model I've tried (sonnet-4.5, sonnet-4.6).

To rule out OpenCode being the cause, I posted the same prompt directly to the Copilot API using the same OAuth token. The burst pattern is already present in the raw SSE from /v1/messages. GPT endpoints (/chat/completions, /responses) don't have it.

The difference seems to come from how OpenCode routes each model: Claude goes through @ai-sdk/anthropic → POST /v1/messages (Anthropic shim), while GPT uses @ai-sdk/github-copilot → POST /chat/completions. The shim batches SSE frames in a way the OpenAI endpoint doesn't. The toolStreaming = false workaround in copilot.ts (for the shim rejecting eager_input_streaming) makes agentic turns worse since the whole tool-call JSON arrives as one chunk.

I have a small Python script that measures inter-chunk gaps directly against the Copilot API — happy to share if it'd be useful for confirming.

Steps to reproduce

  1. Set provider to github-copilot, pick any Claude model (e.g. claude-sonnet-4.6)
  2. Send a prompt that produces a moderately long response
  3. Watch text arrive in bursts with noticeable pauses
  4. Switch to gpt-4o or gpt-5.4 on the same provider — streams without gaps

OpenCode version: 1.14.30
OS: macOS arm64
Terminal: Ghostty

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 30, 2026
  2. rekram1-node commented on Apr 30, 2026

    @rekram1-node
    Collaborator

    Large ai generated issues are auto closed, please dont spam like that.

  3. rekram1-node commented on Apr 30, 2026

    @rekram1-node
    Collaborator
  4. changed the title [-]Bug: Claude via github-copilot streams in bursts (vs smooth GPT/Gemini) — Anthropic /v1/messages shim cadence + toolStreaming=false[/-] [+]Claude streams in bursts via github-copilot provider, GPT streams smoothly[/+] on May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions