Description
Summary
When using a custom provider with @ai-sdk/openai-compatible, API calls complete successfully but no text content is displayed. The API returns valid responses (verified via curl), but opencode shows empty responses with 0 tokens.
Dedalus API: https://docs.dedaluslabs.ai/api
Environment
- opencode version: 1.0.134
- OS: macOS (darwin arm64)
Config
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"dedalus-labs": {
"npm": "@ai-sdk/openai-compatible",
"name": "Dedalus Labs",
"options": {
"baseURL": "https://api.dedaluslabs.ai/v1"
},
"models": {
"openai/gpt-5-mini": {
"name": "GPT-5 Mini"
},
"google/gemini-2.5-flash": {
"name": "Gemini 2.5 Flash"
}
}
}
}
}
Symptoms
- API calls complete (shows ~2s completion time in UI)
- No text content is displayed
- Session data shows
finish: "stop" but no text parts
- Token counts show
input: 0, output: 0
- No error is displayed
API Works Correctly
Direct curl test confirms the API returns valid streaming responses:
curl -s "https://api.dedaluslabs.ai/v1/chat/completions" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "openai/gpt-5-mini", "messages": [{"role": "user", "content": "Say hi"}], "stream": true}'
Returns valid SSE stream:
data: {"choices":[{"delta":{"content":"Hi"}}]}
data: {"choices":[{"delta":{},"finish_reason":"stop"}],"usage":{...}}
data: [DONE]
Likely Cause
The @ai-sdk/openai-compatible package may not be emitting text-start events before text-delta events. In processor.ts, text-delta handling requires currentText to be set (which happens in text-start):
case "text-delta":
if (currentText) { // <-- undefined without text-start
currentText.text += value.text
...
}
break
Without a text-start event, all text-delta events are silently ignored.
Session Data
Stored message shows completion but no content:
{
"finish": "stop",
"tokens": {
"input": 0,
"output": 0,
"reasoning": 0,
"cache": { "read": 0, "write": 0 }
}
}
No text parts are created - only step-start and step-finish parts exist.
OpenCode version
1.0.134
Steps to reproduce
- Add opencode.json
- add Dedalus api key ( "dedalus-labs", using opencode auth login > Other ) (if you dm me on x I will provide you one https://x.com/cgilly2fast)
- Pick a dedalus model
- Send "Hello"
Screenshot and/or share link
Operating System
macOS 15.5 (24F74) (darwin arm64) M1 mac
Terminal
VSCode terminal
Description
Summary
When using a custom provider with
@ai-sdk/openai-compatible, API calls complete successfully but no text content is displayed. The API returns valid responses (verified via curl), but opencode shows empty responses with 0 tokens.Dedalus API: https://docs.dedaluslabs.ai/api
Environment
Config
{ "$schema": "https://opencode.ai/config.json", "provider": { "dedalus-labs": { "npm": "@ai-sdk/openai-compatible", "name": "Dedalus Labs", "options": { "baseURL": "https://api.dedaluslabs.ai/v1" }, "models": { "openai/gpt-5-mini": { "name": "GPT-5 Mini" }, "google/gemini-2.5-flash": { "name": "Gemini 2.5 Flash" } } } } }Symptoms
finish: "stop"but no text partsinput: 0, output: 0API Works Correctly
Direct curl test confirms the API returns valid streaming responses:
Returns valid SSE stream:
Likely Cause
The
@ai-sdk/openai-compatiblepackage may not be emittingtext-startevents beforetext-deltaevents. Inprocessor.ts,text-deltahandling requirescurrentTextto be set (which happens intext-start):Without a
text-startevent, alltext-deltaevents are silently ignored.Session Data
Stored message shows completion but no content:
{ "finish": "stop", "tokens": { "input": 0, "output": 0, "reasoning": 0, "cache": { "read": 0, "write": 0 } } }No text parts are created - only
step-startandstep-finishparts exist.OpenCode version
1.0.134
Steps to reproduce
Screenshot and/or share link
Operating System
macOS 15.5 (24F74) (darwin arm64) M1 mac
Terminal
VSCode terminal