anomalyco / anomalyco/opencode
[Opencode Go] Frequent jitter / possible truncation when calling opencode-go/muse-spark-1.2 via Codex (opencodex proxy, openai-chat)
@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
- Configure opencode-go (baseUrl https://opencode.ai/zen/go/v1, any modelContextWindows)
- ocx sync (catalog 35 models, muse-spark present) and opencodex at 127.0.0.1:10100 (openai_base_url injected)
- 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" - 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.