Skip to content

[FEATURE]: Support session-scoped streaming responses for message submission #17020

Closed as not planned

Description

@geosmart

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Currently, there is no efficient way to receive real-time updates for a specific session without significant overhead. The existing two methods are:

POST /session/:id/message: Synchronous and blocking. This is unsuitable for production as it risks timeouts and consumes server-side threads for long-running tasks.

POST /session/:id/prompt_async: Asynchronous (204), but results are broadcasted via the global /event endpoint. This forces the client to either filter a high-volume stream of all sessions' data or fallback to inefficient polling via GET /session/:id/message.

The Proposal:
I suggest introducing a Stream API (Server-Sent Events) that allows users to receive updates for a specific session directly.

Desired Behavior:

A new endpoint (e.g., POST /session/:id/message/stream or GET /session/:id/events) that returns text/event-stream.
The stream should only contain events relevant to the specific :id.
Alternatively, allow the POST request to return a stream directly as the response body.

Why this matters:

  1. Performance: Reduces client-side CPU usage (no need to filter global noise).
  2. Scalability: Eliminates the need for frequent polling.
  3. UX: Enables low-latency, "typewriter" style responses for a better user experience.

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Mar 11, 2026
  2. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 11, 2026
  3. github-actions commented on Mar 11, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  4. removed
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  5. 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