Skip to content

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

@olllayor

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.

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