Repository navigation
Description
Description
opencode-ai@1.14.29 aborts mid-run with Error: "text part <uuid> not found" when the configured provider is an OpenAI-compatible proxy (LiteLLM v1.83.7-stable). The error fires on the second LLM round-trip, immediately after the first tool result is streamed back to the model.
The same proxy, queried via curl against /v1/chat/completions with stream:true, returns well-formed SSE, and the same proxy serves Aider, Codex, and mini-swe-agent without issue, so the misbehavior appears specific to opencode's stream-part-id reconciliation.
Provider config
~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"openai": {
"name": "LiteLLM proxy (compatible mode)",
"options": {
"baseURL": "http://host.containers.internal:6666/v1",
"compatibility": "compatible"
},
"models": {
"deepseek-chat": { "name": "DeepSeek via LiteLLM" }
}
}
}
}
Expected behavior
The second round-trip completes and the agent applies edits, as it does against compatibility="default" upstream OpenAI traffic.
Hypotheses (educated guesses, not verified)
- The 1.14.x runtime tracks streamed text parts by id (introduced alongside Responses-API integration). When the upstream SSE shape is OpenAI Chat Completions–style (no
idper delta) and is re-marshalled by@ai-sdk/openaiincompatibility=compatiblemode, the part id used at parse time may not match the id used at reassembly time. - Alternatively, LiteLLM's SSE re-encoding may strip / rename a field opencode relies on. (We have not bisected this; happy to run any logging knobs you want.)
Cross-checks that DO work
curlagainst/v1/chat/completionswithstream:truereturns well-formed SSE.- Aider 0.86.2, Codex 0.125.0, and mini-swe-agent 2.2.1 all run successfully against the same proxy.
Adjacent SDK attempts
- Built-in
@ai-sdk/openaiwithcompatibility=compatible→ fails withtext part <uuid> not found @ai-sdk/openai-compatible@1.0.21(provider override) → fails earlier withL.responses is not a function
Offered
- A minimal harness (≈30-line shell script) that spins up LiteLLM in a container, points opencode at it, and runs the prompt above.
- Full stderr + a packet capture /
LITELLM_LOG=DEBUGtrace if you can point at which framing detail is most useful.
Would either help triage?
Plugins
None
OpenCode version
1.14.29 (also reproduced on 1.14.17 and 1.14.31)
Steps to reproduce
- Start LiteLLM v1.83.7-stable as OpenAI-compatible proxy on port 6666 routing
deepseek-chatto DeepSeek's API. - Configure opencode at
~/.config/opencode/opencode.jsonwith the provider config shown in Description (baseURL pointing at the LiteLLM proxy, compatibility="compatible"). - In a fresh git clone with a single trivial Python file
foo.py, run:opencode run --log-level ERROR --model openai/deepseek-chatwith prompt"add a one-line module docstring to foo.py". - Observe: opencode initializes; reads provider config; resolves model.
- First model round-trip succeeds. Model emits a Glob (or Read) tool call.
- Tool result is streamed back.
- Model begins second round-trip with text:
"Let me find the file first." - Runtime aborts with:
Error: "text part 972b8e3b-ac35-4b6f-a8a3-17302a05066b not found" - Process exits non-zero; no patch is written.
Logs: Error: "text part 972b8e3b-ac35-4b6f-a8a3-17302a05066b not found"
Additional context: Reproduced on opencode 1.14.17, 1.14.29, and 1.14.31. Same LiteLLM proxy works fine with Aider 0.86.2, Codex 0.125.0, mini-swe-agent 2.2.1.
Screenshot and/or share link
No response
Operating System
Linux (Debian-based container, Node 22-slim)
Terminal
No response
Activity
github-actions commentedon May 2, 2026
This issue might be a duplicate of existing issues. Please check:
Error: "text part ... not found"as an alternative failure mode, and shares the same LiteLLM + OpenAI-compatible proxy + second round-trip contextravindu-ranasinghe commentedon May 2, 2026
Hey, I'd like to investigate this. I've looked at the related issues (#21346, #6486, #14972) and don't think any of them cover this specific failure, the UUID mismatch on
round-trip 2in Chat Completions + compatibility="compatible" mode seems distinct. Would you be open to assigning this to me?Predator455 commentedon May 2, 2026
Yes, please assign — happy to dig in alongside if useful.
I can provide:
Also happy to bisect within 1.14.x if narrowing the first-bad-version helps.
Let me know what's most useful.
bbartels commentedon May 11, 2026
i ran into this with amazon-bedrock and opus 4.7 as well
alex-pathcourse commentedon May 11, 2026
You're seeing 'text part not found' errors during streaming when using an OpenAI-compatible proxy like LiteLLM after a tool call response. PathCourse Health handles streaming and partial text reconstruction natively across round-trips so you don't have to manage chunk parsing or proxy compatibility.
Working example: https://github.com/pathcourse-health/pch-integration-examples#framework-adapters
github-actions commentedon Jul 11, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
nalbion commentedon Sep 15, 2026
why was this closed? I'm seeing this in 1.18.31
nalbion commentedon Sep 18, 2026
This is confirmed to be a LiteLLM issue - they've got a fix already - BerriAI/litellm#41564
If you want to unblock in the meantime, you can point OpenCode at chat completions instead of the Responses API, for example by setting the provider's npm package to "@ai-sdk/openai-compatible" in opencode.json