Skip to content

bug: opencode-go gateway returns reasoning_content instead of content in streaming responses #37635

Closed as not planned

Description

@Nineu1124

OpenCode Version: 1.18.3
OS: Windows 10
Terminal: PowerShell 7.6

Summary

The opencode-go gateway wraps ALL model streaming responses in a Chain-of-Thought wrapper, putting the assistant's actual output in delta.reasoning_content instead of delta.content. This causes the agent loop to receive empty content and exit immediately ("exiting loop" after step 1).

Steps to reproduce

  1. opencode providers login > authenticate with opencode-go API key
  2. opencode -m opencode-go/grok-4.5 (or any opencode-go model)
  3. Send any message, e.g. "Say hello"
  4. Observe: session exits after ~2s with no response

Root cause

Direct API test of the opencode-go gateway streaming endpoint:

POST https://opencode.ai/zen/go/v1/chat/completions
{"model":"grok-4.5","messages":[{"role":"user","content":"What is 1+1? Reply ONLY with the number."}],"max_tokens":200,"stream":true}

Actual output — every chunk uses reasoning_content, the actual answer appears only in the final chunk as a single content delta:

data: {"choices":[{"delta":{"role":"assistant","reasoning_content":"The"}}]}
data: {"choices":[{"delta":{"reasoning_content":" user"}}]}
data: {"choices":[{"delta":{"reasoning_content":" asks"}}]}
... (18 more reasoning_content-only chunks) ...
data: {"choices":[{"delta":{"content":"2"}}]}
data: {"choices":[{"finish_reason":"stop","delta":{}}]}

Token breakdown: reasoning_tokens=33, completion_tokens=1 — 97% consumed by the forced CoT wrapper.

The non-streaming endpoint returns content correctly — only streaming is affected.

Expected behavior

delta.content should contain the streaming response text, matching the non-streaming behavior.

Affected models

ALL opencode-go models: grok-4.5, deepseek-v4-pro, deepseek-v4-flash, kimi-k3, kimi-k2.7-code, kimi-k2.6, glm-5.1, glm-5.2, mimo-v2.5, mimo-v2.5-pro, minimax-m2.7, minimax-m3, qwen3.6-plus, qwen3.7-max, qwen3.7-plus

Additional observation

When requesting "model":"deepseek-v4-pro", the streaming response returns "model":"grok-4.5" in the chunk metadata — possible model routing issue.

Activity

  1. github-actions commented on Jul 18, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. github-actions commented on Sep 18, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

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