Skip to content

SSE /event endpoint does not forward events to clients in v1.14.48 (regression from v1.14.40) #26866

@Alice-space

Description

@Alice-space

Bug Description

The /event SSE endpoint in opencode 1.14.48 does not forward any internal events to connected clients. The endpoint accepts connections and sends server.connected, but no subsequent events (message.part.updated, message.updated, session.status, session.idle, etc.) are ever delivered.

This worked correctly in v1.14.40 and is broken in v1.14.48.

Environment

  • OS: Linux x86_64 (Rocky Linux 9)
  • OpenCode version: 1.14.48 (opencode serve --hostname 127.0.0.1 --port 0)
  • Connection: direct localhost (no proxy, no tailscale, no reverse proxy)
  • Client: curl (also reproduced with Go net/http client)

Steps to Reproduce

# Terminal 1: Start the server
opencode serve --hostname 127.0.0.1 --port 0

# Terminal 2: Connect to SSE event stream
curl -sN "http://127.0.0.1:PORT/event" -H "Accept: text/event-stream"

# Terminal 3: Create session + send prompt
SESSION_ID=$(curl -s http://127.0.0.1:PORT/session -H "Content-Type: application/json" -d "{}" | python3 -c "import json,sys;print(json.load(sys.stdin)['id'])")
curl -s http://127.0.0.1:PORT/session/${SESSION_ID}/prompt_async -H "Content-Type: application/json" -d '{"parts":[{"type":"text","text":"say hello"}]}'

Expected Behavior

Terminal 2 receives SSE events as the prompt is processed:

data: {"type":"server.connected","properties":{}}
data: {"type":"message.updated","properties":{...}}
data: {"type":"message.part.updated","properties":{...}}
data: {"type":"session.idle","properties":{...}}

Actual Behavior

Terminal 2 only receives the initial connection event, nothing else:

data: {"id":"evt_...","type":"server.connected","properties":{}}

No further events appear, even after waiting several minutes.

Evidence

  1. Server logs confirm events are published internally:
INFO  service=bus type=message.part.delta publishing
INFO  service=bus type=message.part.updated publishing
INFO  service=bus type=session.idle publishing
  1. prompt_async returns 204 — prompt was accepted and processed.

  2. Same workflow on v1.14.40 works correctly — SSE events arrive in real-time.

  3. Session-specific /session/{id}/event returns HTML (web UI), not SSE — no alternative endpoint.

Impact

Breaks all integrations relying on /event SSE for real-time event delivery. Only workaround is downgrading to v1.14.40.

Related Issues

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions