Skip to content

Dose APIs of opencode support session-level SSE event listener? #7451

Closed as not planned

Description

@1169361410

Question

It seems that I just noticed the APIs offer both global-level and project-level event listeners, such as /global/event and /event for subscribing to server-sent events (SSE). 

So I was wondering:

Is there a way to implement a workflow where a user sends an asynchronous prompt (e.g., via POST /session/{id}/prompt_async), and a backend worker/thread can directly listen to session-level events, filter events for that specific session ID, and then push the real-time generated updates back to the corresponding user’s session?

Specifically:
• Can the server or client maintain a long-running listener on /event (project level) or /global/event (global level) and, for each incoming SSE event, dispatch it only to the relevant session based on sessionID?
• Is there an established pattern for routing those session events back to the correct user instance (for example via WebSocket, callback, or SSE client)?
• Is this supported or recommended by the SDK or server design for real-time interactive usage?

Activity

  1. thdxr commented on Mar 25, 2026

    @thdxr
    Member

    To stay organized issues are automatically closed after 90 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