Custom OpenAI-compatible provider returns no text content
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
This issue might be a duplicate of existing issues. Please check:
- #5187: Ollama with @ai-sdk/openai-compatible provider also reports empty/missing content - user messages arrive as empty arrays instead of actual text
Both issues use the @ai-sdk/openai-compatible provider and report content not being displayed despite successful API calls. The symptoms and likely root cause (missing text-start events before text-delta events) suggest these could be related issues.
Feel free to ignore if your case is specific to the Dedalus Labs provider.
Hm every other provider i've seen emits them correctly, it seems like it'd be a bug on the provider side rather than the sdk no?
I am not 100% sure thats the issue, I was trying help with beginning deductions