Skip to content

OpenAI-compatible gpt-5.5 aborts mid-stream with unexpected EOF while same endpoint works in Codex #29187

Closed as not planned

Description

@88lin

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 /v1 endpoint

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

  1. Configure a custom OpenAI-compatible provider.
  2. Set default model to mygpt/gpt-5.5.
  3. Start a normal opencode session.
  4. Ask for a response long enough to stream for a while.
  5. 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

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

  1. github-actions commented on May 25, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of or closely related to existing issues. Please check:

    If your issue is distinct from all of the above, feel free to clarify what differentiates it.

  2. 88lin commented on May 25, 2026

    @88lin
    Author

    Thanks. This may share the same root cause as #26156 / #28833, but I filed it separately because the reproducing condition is specifically:

    • custom @ai-sdk/openai-compatible provider
    • gpt-5.5
    • same endpoint and model are stable in Codex
    • gpt-5.4 works in opencode with the same provider setup
    • failure appears as mid-stream unexpected EOF, not an immediate startup/config failure

    If #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.

  3. naufalahmadfauz commented on May 25, 2026

    @naufalahmadfauz

    I Thought i was the only one. it hangs after a few minutes, no error output, just silent.

  4. DamianB-BitFlipper commented on May 27, 2026

    @DamianB-BitFlipper
    Contributor

    Seconded that I'm experiencing 5.5 hang after a bit. I have to cancel and tell it to "continue" for it to start.

  5. github-actions commented on Jul 27, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions