Skip to content

opencode-go/muse-spark-1.2-contributor 502 truncation on large tool-call tasks (mid tool call without terminal signal) - comprehensive evidence #2194

Closed

Description

@Yuxin-Qiao

Client or integration

Codex App

Area

Provider adapter

Summary

opencode-go/muse-spark-1.2-contributor via opencodex proxy 10100 consistently truncates on large-context + tool-call streams: 502 upstream_server_error upstream stream ended mid tool call without a terminal signal — possible truncation src/adapters/openai-chat.ts:1734. Small prompts succeed, the same large CodexBar sweep fails at all reasoning levels low/medium/high/xhigh even after reinstall, while opencode-go/deepseek-v4-flash on identical prompt succeeds 200. Codex then does 5/5 useless retries.

Reproduction

  1. Environment: opencodex 2.27.0 bun ~/.hermes/node/lib/node_modules/@bitkyc08/opencodex , codex 0.147.0 openai_base_url http://127.0.0.1:10100/v1 , macOS 15.5 Darwin 24.x, muse-spark context 1048576 baseUrl https://opencode.ai/zen/go/v1, workspace CodexBar-bug:feat main a3457dafb
  2. Minimal large reproduction (deterministic):
codex exec -m opencode-go/muse-spark-1.2-contributor -c model_reasoning_effort="low" --color never \
"Continue aligning the status of CodexBar-bug:feat — sweep branches, local changes and PR/CI. Just run bash tools \`git status\` and \`git branch -vv\` and summarize"
# also reproduces with medium/high/xhigh, same result
  1. Observe Codex Reconnecting 1/5...5/5 then stream disconnected before completion: upstream stream ended mid tool call without a terminal signal — possible truncation, localhost:10100/#logs shows 502 with unreported tokens.
  2. Control:
codex exec -m opencode-go/deepseek-v4-flash -c model_reasoning_effort="high" --color never "same prompt"
# → 200, git status + 41 branches returned
codex exec -m opencode-go/muse-spark-1.2-contributor "hi" # small → 200 even on xhigh

Version

2.27.0

Operating system

macOS 15.5 (Darwin 24.6.0, arm64)

Provider and model

opencode-go / muse-spark-1.2-contributor

Logs or error output

~/.opencodex/usage.jsonl truncated batch (high, still truncates):

ocx-mt1aawks-4f ts 1787216068972 eff xhigh/xhigh status 502 dur 3646 upstreamError mid tool call truncation
ocx-mt1b32u3-d ts 1787217383451 eff high/high status 502 dur 2654
ocx-mt1b3655-e ts 1787217387737 eff high/high status 502 dur 2433
ocx-mt1bdrba-3 ts 1787217881734 eff high/medium(after high->medium map) status 502 dur 3409
...
ocx-mt1bhd5b-h ts ... eff low/low status 502  # even low fails on large sweep

All share: adapter openai-chat status 502 errorCode upstream_server_error recoveryKinds [] usageStatus unreported

Small control (same model, small prompt, succeeds):

ocx-mt1b51yc-2 eff xhigh/xhigh status 200 totalTokens 1066 dur 2500
ocx-mt1bbmaw-2 eff high/medium status 200

DeepSeek control (same large sweep, succeeds):

ocx-mt1bns5q-3 model deepseek-v4-flash eff high status 200
ocx-mt1bo65y-5 model deepseek-v4-flash eff high status 200
codex exec deepseek → git status + 41 branches returned in <30s

Matrix tested:

Prompt size Model Effort Result
small hi (8 tokens) spark xhigh/high/medium/low 200
synthetic 40k + bash tool spark medium/low 200 / high timeout
CodexBar large sweep spark low/medium/high/xhigh 502 (all)
CodexBar large sweep deepseek high 200
CodexBar large sweep gpt-5.6-luna low 200

~/.opencodex/service.log diagnostic:
debugProviderDiagnostic openai-chat stream-truncated {finishReason:null hadUsage:false pendingToolCalls:1} then yield error mid tool call

Screenshots and supporting files

  • localhost:10100/#logs 2026/08/20 17:16:39-58 5x muse-spark high 502 unreported
  • Codex UI Reconnecting 1/5...5/5 screenshots (large sweep) vs deepseek success screenshots available on request

Redacted configuration

// ~/.opencodex/config.json providers.opencode-go
{
  "modelReasoningEfforts": { "muse-spark-1.2-contributor": ["low","medium","high","xhigh","max"] },
  "modelDefaultReasoningEfforts": { "muse-spark-1.2-contributor": "high" },
  "modelContextWindows": { "muse-spark-1.2-contributor": 1048576 }
}
// ~/.codex/config.toml (reproduces on default)
model = "opencode-go/muse-spark-1.2-contributor"
model_reasoning_effort = "high"
openai_base_url = "http://127.0.0.1:10100/v1"

After reinstall (ocx uninstall → service install → sync --restart-codex) disabledModels reset and spark still reproduces, proving not local corruption. Mapping high->medium and modelMaxOutputTokens 65536 tested, still 502 on large sweep.

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. added
    bugSomething isn't working
    providerProvider adapters, OpenAI-compat presets, upstream API quirks
    streamingSSE, WebSocket, terminal stream frames
    toolstool_calls, MCP, web-search / sidecar tools
    on Aug 20, 2026
  2. coderabbitai commented on Aug 20, 2026

    @coderabbitai
    Contributor
    ⚠️ Possible Duplicate Issue(s)
    🔗 Related PRs

    #2165 - fix(openai-chat): treat a non-string repeat as padding once that field is known [merged]
    #2162 - fix(anthropic): frame the opening turn so AgentRouter stops blocking non-English [merged]
    #2186 - [WRONG BRANCH] release: promote dev to main for 2.28.0 [closed]
    #2187 - [WRONG BRANCH] release: sync dev into preview for 2.28.0 [closed]
    #2160 - fix(providers): identify opencode-free with the client User-Agent it claims [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  3. lidge-jun commented on Aug 20, 2026

    @lidge-jun
    Owner

    리뷰 · 우선순위 69 / 80

    #2156이랑 같은 구멍임. 제목에 contributor 붙은 모델만 다른데 에러 문자열이 똑같음. src/adapters/openai-chat.ts:1825가 finishReason 없고 pendingToolCalls.length > 0이면 upstream stream ended mid tool call without a terminal signal — possible truncation 냄. 이슈에 적은 stream-truncated {finishReason:null hadUsage:false pendingToolCalls:1}이 그 로그 그대로임.

    라인 번호는 2.27.0 기준 1734가 아님. 지금 dev HEAD 96f288d59에선 그 자리는 툴콜 arguments 검증이고, 잘림 분기는 1825임. #2180이 하트비트 넣으면서 밀렸음. 그 PR 주석도 이거 고친 거 아니라고 적혀 있음 (:1752-1755). 스톨 워치독이랑 다른 프레임임.

    작은 hi는 200, CodexBar 큰 스윕은 low/medium/high/xhigh 전부 502, deepseek랑 luna는 같은 스윕이 200. 업스트림이 툴콜 중간에 소켓을 닫거나, spark가 finish_reason/[DONE] 없이 끊는 쪽에 가깝음. ocx가 임의로 자른 증거는 아직 없음. recoveryKinds []라서 ocx 재시도가 아님. Codex App 5/5는 클라 재접속임. 같은 잘림을 다섯 번 더 보는 거임.

    #2193은 이미 닫혔음. 이 이슈랑 #2156을 둘 다 열어두면 중복임. 증거는 여기가 더 빵빵하지만 SSE 원본은 여전히 없음. 캡처 없이 flush-on-EOF 때리면 잘린 툴콜을 성공으로 포장함.

    해결방안: #2156을 메인으로 두고 이 매트릭스/로그를 거기 코멘트로 옮긴 다음 #2194는 duplicate로 닫음. 고치려면 zen/go SSE 원본이 필요함. finish_reason 없이 끊기는지, 우리가 먼저 끊는지. 캡처 오기 전엔 머지하지 말 것. #2180 재리베이스도 의미 없음.

    이 댓글은 grok-bot이 작성했습니다

  4. Ingwannu commented on Aug 20, 2026

    @Ingwannu
    Owner

    Thanks for the detailed matrix. I moved the additional evidence into #2156, which owns the identical openai-chat EOF-with-pending-tool-call failure.

    The exact error and diagnostic state are the same, and keeping both open would split the raw-SSE investigation. The current guard must remain fail-closed until we can distinguish an upstream terminal-frame omission from a proxy-side truncation; flushing partial tool JSON would be unsafe.

    Closing this as a duplicate of #2156.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingproviderProvider adapters, OpenAI-compat presets, upstream API quirksstreamingSSE, WebSocket, terminal stream framestoolstool_calls, MCP, web-search / sidecar tools

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions