Skip to content

Server becomes unresponsive after external client disconnects during SSE streaming #15149

Closed as not planned

Description

@zaxbysauce

Description

When running opencode serve with external clients (e.g., via curl or API client), if the client disconnects abruptly while connected to SSE endpoints (/event or /global/event), the server enters a corrupted state where subsequent requests fail with "Unexpected EOF" errors.

Logs:

ERROR 2026-02-18T15:34:10 +10ms service=server error=Unexpected EOF failed
ERROR 2026-02-18T15:34:10 +1ms service=server error=Unexpected EOF failed

Plugins

"opencode-swarm@latest", "opencode-anthropic-auth@latest", "opencode-openai-codex-auth@latest", "opencode-zaxbystatus@latest"

OpenCode version

1.2.14

Steps to reproduce

Start opencode serve
Connect an external client to the SSE endpoint (e.g., curl http://localhost:4096/event)
Disconnect the client abruptly (Ctrl+C or close connection)
Try to make another request to the server
Server fails to respond - subsequent requests also show "Unexpected EOF" errors
Expected behavior: Server should remain stable and continue accepting new requests after client disconnects.

Screenshot and/or share link

No response

Operating System

Windows

Terminal

opencode electron gui

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Feb 26, 2026
  2. github-actions commented on Feb 26, 2026

    @github-actions
    Contributor

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

    If your issue is specifically about the server becoming unresponsive (rather than just a resource leak), it may still be worth keeping open as a distinct symptom — but please review #14091 first to see if it covers your case.

  3. neocody commented on Mar 6, 2026

    @neocody

    Seeing this in production with CodeNomad (desktop client for OpenCode).

    OpenCode serve closes the /event SSE endpoint after ~7 seconds:

    service=server method=GET path=/event status=started
    service=server method=GET path=/event status=completed duration=7171
    

    After this, the SSE stream never reopens server-side. The desktop client loses all events and the UI goes blank across all workspace instances.

    OpenCode 1.2.18, macOS 15.7.4 ARM64. Multiple workspaces open simultaneously.

  4. assigned and unassigned on Apr 26, 2026
  5. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  6. github-actions commented on Jul 4, 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