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

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 uninstallservice installsync --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.

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