anomalyco / anomalyco/opencode

[Opencode Go] Frequent jitter / possible truncation when calling opencode-go/muse-spark-1.2 via Codex (opencodex proxy, openai-chat)

Open
#43,680 1 comment 0 reactions 1 assignee View on GitHub

@fwang is already working on this.

Since Aug 20, 2026.

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

Description

Description

Calling opencode-go/muse-spark-1.2-contributor (also muse-spark-1.2) through Codex → opencodex (openai-chat → https://opencode.ai/zen/go/v1/chat/completions) frequently jitters: Codex spins, retries 1/5…5/5, then stream disconnected before completion: upstream stream ended mid tool call without a terminal signal — possible truncation. Pure chat (echo hi) is stable; tool-calling turns (List files, cat …, any tool_calls with ~119 tools) reproduce at high rate.
Possible root cause: upstream stream for this model ends as tool_calls → usage/cost with no finish_reason and no [DONE]. src/adapters/openai-chat.ts:1689 treats !sawFinish && pendingToolCalls>0 as truncation even when pendingUsage already arrived. deepseek-v4-flash under identical conditions correctly sends finish_reason:"tool_calls" and succeeds.
[ocx:openai-chat:stream-truncated] {"finishReason":null,"hadUsage":true,"pendingToolCalls":1}

Plugins

opencodex (on codex)

OpenCode version

1.18.11

Steps to reproduce
  1. Configure opencode-go (baseUrl https://opencode.ai/zen/go/v1, any modelContextWindows)
  2. ocx sync (catalog 35 models, muse-spark present) and opencodex at 127.0.0.1:10100 (openai_base_url injected)
  3. Via Codex (ChatGPT account, codex 0.147.0, opencodex 2.28.0):
    codex exec -m opencode-go/muse-spark-1.2-contributor "List files"
    or: codex exec -m opencode-go/muse-spark-1.2-contributor "Run: cat | head -n 3"
  4. Enable ocx debug provider on to see stream-truncated on each tool turn.
Screenshot and/or share link

No response

Operating System

CentOS7

Terminal

Linux Terminal

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.