Repository navigation
Description
Summary
[email protected] intermittently crashes or aborts with unexpected EOF when using a custom OpenAI-compatible provider with gpt-5.5. The same endpoint and same model work reliably in OpenAI Codex, and other models such as gpt-5.4 and DeepSeek work in opencode.
This looks like an opencode compatibility/regression issue in the OpenAI-compatible / Responses streaming or session handling path, not a provider outage.
Environment
- OS: Windows
- Install method:
npm install -g opencode-ai - OpenCode version:
1.15.10 - Provider package:
@ai-sdk/openai-compatible - Model:
gpt-5.5 - Endpoint: custom OpenAI-compatible
/v1endpoint
Config shape
{
"provider": {
"mygpt": {
"name": "mygpt",
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://<redacted>/v1"
},
"models": {
"gpt-5.5": { "name": "gpt-5.5" },
"gpt-5.4": { "name": "gpt-5.4" }
}
}
},
"model": "mygpt/gpt-5.5"
}I also tried increasing provider timeouts:
"options": {
"baseURL": "https://<redacted>/v1",
"timeout": 900000,
"chunkTimeout": 120000
}That does not appear to address the underlying issue.
Behavior
- Configure a custom OpenAI-compatible provider.
- Set default model to
mygpt/gpt-5.5. - Start a normal opencode session.
- Ask for a response long enough to stream for a while.
- opencode starts outputting normally, then aborts with
unexpected EOF.
Expected:
- opencode should continue streaming to completion, as Codex does with the same endpoint and same model.
Actual:
- opencode aborts mid-output with
unexpected EOF.
Why this seems opencode-specific
- Same model and same endpoint work in Codex for long-running usage.
gpt-5.4and DeepSeek work in opencode with the same general setup.- This resembles existing opencode issues where
Unexpected EOFis a secondary symptom after stricter parsing or session/SSE errors:
Suspected cause
While investigating, one likely compatibility issue stood out in the Responses adapter:
packages/core/src/github-copilot/responses/openai-responses-language-model.ts
The non-streaming Responses schema currently treats output_text.annotations as required:
z.object({
type: z.literal("output_text"),
text: z.string(),
logprobs: LOGPROBS_SCHEMA.nullish(),
annotations: z.array(...)
})Some OpenAI-compatible providers omit annotations when there are no annotations. Codex appears tolerant of this shape. If opencode routes gpt-5.x through a Responses-compatible path, a missing annotations field could trigger a validation failure that later surfaces as unexpected EOF.
A minimal compatibility fix may be to default omitted annotations to an empty array:
annotations: z.array(...).default([])and keep the existing loop unchanged:
for (const annotation of contentPart.annotations) { ... }A regression test could simulate a /responses JSON response containing:
{
"type": "message",
"role": "assistant",
"id": "msg-1",
"content": [
{ "type": "output_text", "text": "Hello", "logprobs": null }
]
}and assert that doGenerate() returns the text instead of throwing.
Notes
I am not fully certain this is the only path causing the EOF, since the visible error is only unexpected EOF. But given the Codex comparison and the related issues above, the bug appears to be in opencode parsing/session handling rather than the model endpoint itself.
Activity
github-actions commentedon May 25, 2026
This issue might be a duplicate of or closely related to existing issues. Please check:
annotationsfield onoutput_textparts crashes the provider adapter (Kimi/Moonshot hit this exact schema issue)Unexpected EOFsurfacing from a session read/write race — same error message, possibly same underlying pathIf your issue is distinct from all of the above, feel free to clarify what differentiates it.
88lin commentedon May 25, 2026
Thanks. This may share the same root cause as #26156 / #28833, but I filed it separately because the reproducing condition is specifically:
@ai-sdk/openai-compatibleprovidergpt-5.5gpt-5.4works in opencode with the same provider setupunexpected EOF, not an immediate startup/config failureIf #28833 is the canonical tracking issue for OpenAI-compatible SSE/schema validation failures, this can be closed as duplicate. Otherwise, I think this case is useful because it narrows the regression to opencode's handling of a Codex-compatible OpenAI-compatible stream.
naufalahmadfauz commentedon May 25, 2026
I Thought i was the only one. it hangs after a few minutes, no error output, just silent.
DamianB-BitFlipper commentedon May 27, 2026
Seconded that I'm experiencing 5.5 hang after a bit. I have to cancel and tell it to "continue" for it to start.
github-actions commentedon Jul 27, 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.