Skip to content

[BUG]: TUI does not live-render messages when prompt is POSTed externally via /session/{id}/prompt_async #26671

Closed as not planned

Description

@harshitsinghbhandari

Description

When a session is open in the TUI and a prompt is sent via POST /session/{id}/prompt or prompt_async (e.g. from the web UI, the SDK, or any external HTTP client), the TUI does not live-render the resulting user prompt or the streaming assistant reply. Messages are missing from the TUI view in real time.

However, the messages are correctly persisted: if the user Ctrl+C to detach the TUI and then resumes the same session, all the externally-injected turns appear. The web UI also live-renders them correctly throughout. So this is specifically a live-render / SSE-subscription bug in the TUI client, not a message-storage issue.

The server stores both the user prompt and the assistant reply correctly (verified via GET /session/{id}/message); the agent runs the inference and the response is persisted. The TUI's view of the active session simply doesn't get refreshed by the relevant SSE events while attached.

Steps to reproduce

  1. Start opencode (TUI) — server auto-starts on http://127.0.0.1:4096.
  2. (Optional) Open the web UI on the same server to confirm comparative behavior.
  3. Note the active session id (e.g. curl http://127.0.0.1:4096/session).
  4. From any external shell, POST a prompt to that session:
    curl -X POST http://127.0.0.1:4096/session/<SESSION_ID>/prompt_async \
      -H 'Content-Type: application/json' \
      -d '{
        "parts":[{"type":"text","text":"hello from external POST"}],
        "model":{"providerID":"<provider>","modelID":"<model>"}
      }'
  5. Observed: TUI shows nothing. Web UI shows both the user prompt and the streaming assistant reply.
  6. Ctrl+C the TUI, then resume the same session (e.g. opencode and pick the session, or --continue). All the externally-injected turns now appear correctly.

Expected

The TUI live-renders prompts and assistant replies regardless of which client (or HTTP request) originated them, identically to the web UI.

Why this matters

Prevents external tools from driving an opencode session a human is supervising via the TUI — the human loses real-time visibility until they restart the TUI. Relevant for agent orchestrators that drive opencode sessions over HTTP while a human watches via the TUI.

Environment

  • OpenCode version: 1.14.46
  • Operating System: macOS Darwin 25.4.0 arm64
  • Terminal: VS Code integrated terminal (xterm-256color)
  • Plugins: none

Activity

  1. jlongster commented on May 11, 2026

    @jlongster
    Contributor

    Hi @harshitsinghbhandari !

    Can you see if this PR fixes this issue? #26936

  2. github-actions commented on Jul 11, 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