Skip to content

[Bug]: OpenCode provider freezes on first message — SSE events silently dropped #2691

Description

@olllayor

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/desktop

Steps to reproduce

  1. Configure an OpenCode provider in t3code (no server URL → spawns local opencode serve)
  2. Verify provider shows as connected with models listed
  3. Start a new session
  4. Send any message

Expected behavior

Events stream back via SSE (content deltas, tool calls, turn completion).

Actual behavior

promptAsync returns 204 immediately. The composer/turn starts but no content or error ever arrives. Session stays in "running" state indefinitely. The event.subscribe() SSE stream IS receiving events — verified by hitting GET /global/event directly — but handleSubscribedEvent drops every one.

Impact

Major degradation or frequent failure

Version or commit

main @ latest (also affects published v0.0.23 based on bundled SDK range ^1.3.15)

Environment

macOS, any browser, any Bun/Node version. Reproduced with opencode CLI v1.14.50 and @opencode-ai/sdk v1.4.7.

Logs or stack traces

Root cause: The opencode server wraps SSE events in a payload envelope:
{"payload": {"type": "session.status", "properties": {"sessionID": "ses_...", ...}}}
But handleSubscribedEvent at apps/server/src/provider/Layers/OpenCodeAdapter.ts:311 reads event.properties.sessionID instead of event.payload.properties.sessionID. Since the session ID check always evaluates to undefined !== "ses_...", ALL events are silently discarded.

Screenshots, recordings, or supporting files

SCR-20260514-ooro.jpeg

Workaround

Run t3code from source with the patch applied. Alternatively, pin an older opencode CLI version that didn't use the payload wrapper.

Activity

  1. added
    bugSomething is broken or behaving incorrectly.
    needs-triageIssue needs maintainer review and initial categorization.
    on May 14, 2026
  2. obrassard commented on May 14, 2026

    @obrassard

    I can confirm I have the same issue

  3. aashishsingla567 commented on May 14, 2026

    @aashishsingla567

    Same issue

  4. lucasayb commented on May 14, 2026

    @lucasayb

    Same issue

  5. varo6 commented on May 15, 2026

    @varo6

    having the same issue here. To reproduce: same as OP.

    Im on version 0.0.25-nightly.20260515.295

  6. tplack commented on May 17, 2026

    @tplack

    Can confirm this issue on latest version
    0.0.24 (ea20e80)

  7. varo6 commented on May 20, 2026

    @varo6

    This is still open but with latest opencode version and latest nightly version is fixed for me. 0 errors. (Maybe it gets stuck with a bash call that takes time but i think that might be the model problem and not the program)

  8. juliusmarminge commented on Jun 9, 2026

    @juliusmarminge
    Member

    Duplicate of #2644

    Same regression — OpenCode SSE events silently dropped by the adapter (the root cause pinned here matches the discussion there). Thanks for the sharp diagnosis; linking it from the canonical issue #2644 so it informs the fix.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken or behaving incorrectly.needs-triageIssue needs maintainer review and initial categorization.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions