Skip to content

ox-alpha-free (Go free tier): long generations severed server-side without finish_reason — strict clients throw "Stream ended without finish_reason" #44385

Closed

Description

@Animnia

Description

Model: ox-alpha-free (Go plan free tier, "Ox Alpha Free (Unlimited)")
Endpoint: https://opencode.ai/zen/go/v1/chat/completions (OpenAI-compatible SSE, stream: true)
Client: Pi coding agent (earendil-works/pi v0.84.2) — strict OpenAI-SSE parser
OS: Windows 11

On long generations, the gateway severs the stream server-side without emitting finish_reason and without data: [DONE]. Strict OpenAI-compatible clients therefore throw Stream ended without finish_reason and discard the whole partial response. This is 100% reproducible with a complex prompt, and is the ox-alpha-free instance of the same gateway bug class as #43379 / #43882 (muse-*) and #44148 (mid-stream cutoffs on long-reasoning requests).

Why the complex prompt triggers it

ox-alpha-free burns its entire budget on reasoning. A max_tokens=8000 request produced 3134 reasoning tokens and 0 visible content tokens. Complex prompts (e.g. "write a complete interactive single-file HTML") push the reasoning phase past the gateway's patience window (3–7 min), at which point the stream is killed. Simple prompts finish reasoning quickly and complete normally — which is why the failure only shows up on long tasks.

Reproduction (direct HTTPS probes, same API key, no agent in the loop)

Prompt used:

我需要一个解释洛伦兹变换的可视化科普设施,你最好用二维例子,x-y-t立体网格坐标,
附带交互组件。让我完全理解,你必须保证这个科普设施能让我完全理解为啥(ct)^2 - x^2 - y^2是不变量。
使用单html文件构建
Request Result
Simple prompt ("1+1"), max_tokens=200 OK: finish_reason="stop" + [DONE] in 15s
Complex prompt, max_tokens=8000 Gateway emits finish_reason="length" properly, but usage shows 3134 reasoning tokens / 0 content tokens — the model never starts writing an answer
Complex prompt, max_tokens=32000 Stream severed at 403s mid-reasoning: last chunk is a complete JSON reasoning delta, then EOF. No finish_reason, no [DONE], 0 text chars
Complex prompt, max_tokens=131072 (what strict clients send) Stream severed at 211s mid-reasoning, same signature: clean close after a complete chunk, no finish_reason, no [DONE]
Complex prompt + reasoning_effort="low" Parameter appears to be ignored: reasoning tokens 3134 (vs 3130 baseline), still 0 content
Same complex prompt on deepseek-v4-flash via the same gateway/key Completes normally: finish_reason="stop" + [DONE], 174k chars reasoning + 20k chars answer, 313s

The kill time varies (211s / 403s across runs), so it looks like server-side preemption or a resource cap rather than a fixed client-visible limit.

Client-side error in strict clients

When the stream ends without finish_reason, pi's OpenAI parser throws:

Error: Stream ended without finish_reason

and discards the partial response (per-spec: the final chunk must carry a non-null finish_reason followed by data: [DONE]).

Additional framing issue

In one captured stream, 141 of ~2,378 events contained raw newlines embedded inside JSON strings (the reasoning_content delta spans multiple physical lines), splitting a single SSE event across several data:-free lines. Line-based SSE parsers see these as truncated JSON events.

Expected behavior

When the gateway severs a generation (time cap, preemption, quota), it must still close the OpenAI-compatible stream per spec: a final chunk with finish_reason (e.g. "length") followed by data: [DONE]. The 8k-cap probe shows the gateway can do this — it's specifically the long-run kill path that omits the terminal chunk.

Related issues

Activity

  1. github-actions commented on Aug 23, 2026

    @github-actions
    Contributor

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

    (You've already referenced #44148, #43379, and #43882 in your report, which are the closest gateway-level duplicates — good cross-linking.)

  2. rekram1-node commented on Aug 24, 2026

    @rekram1-node
    Collaborator

    We are working with the provider of the stealth model, but they are having issues on their end, I think this specific one should be resoolved now

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