anomalyco / anomalyco/opencode

OpenCode Go: GPT-5.6 Luna truncates streaming tool-call responses

Open
#40,888 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

Summary

GPT-5.6 Luna through the OpenCode Go provider fails when a request uses streaming together with tool definitions. The upstream stream emits response.created and then fails or terminates during a tool call. The same model works when the request is non-streaming/buffered.

Environment

  • Provider: OpenCode Go
  • Endpoint: https://opencode.ai/zen/go/v1
  • Model: gpt-5.6-luna
  • Client/proxy: OpenCodex 2.10.2
  • OS: macOS
  • Adapter: OpenAI-compatible chat adapter; same behavior observed through a Responses adapter

Reproduction matrix

Request Result
stream:false + tools Works
stream:true + no tools Works
stream:true + tools Fails with HTTP 502 / truncated tool-call stream

Observed error: upstream stream ended mid tool call without a terminal signal — possible truncation

Expected behavior

A streaming tool request should produce a complete terminal tool-call event sequence, or return a normal structured API error.

Workaround

Buffer upstream (stream:false) and reframe the completed response as downstream SSE. This removes token-by-token output but allows the tool loop to complete.

Plugins

OpenCode Go provider (openai-chat adapter); OpenCodex 2.10.2

OpenCode version

OpenCode Go endpoint; OpenCodex 2.10.2 client/proxy

Steps to reproduce
  1. Send a request to the OpenCode Go endpoint using model gpt-5.6-luna, at least one function tool, and streaming enabled.
  2. Observe response.created, followed by HTTP 502 or stream termination during the tool call.
  3. Repeat with stream:false + the same tool: it completes.
  4. Repeat with streaming but no tools: it completes.
Screenshot and/or share link

No response

Operating System

macOS

Terminal

Codex Desktop integrated environment

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the OpenAI-compatible chat adapter and the Responses adapter entry points, then reproduce the listed matrix with GPT-5.6 Luna, tools, and streaming enabled. Trace where the stream ends after response.created and compare it with the buffered path. Done means complete terminal tool-call events or a normal structured API error instead of truncation or HTTP 502.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.