GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [Bug]: Externally injected prompt (by POST) not rendered in TUI while message data intact in GET · Issue #41289 · anomalyco/opencode

[Bug]: Externally injected prompt (by POST) not rendered in TUI while message data intact in GET #41289

New issue
Copy link
New issue
Copy link
Closed
Closed
[Bug]: Externally injected prompt (by POST) not rendered in TUI while message data intact in GET#41289
Copy link
Assignees
simonklee

Description

@azure-ether
azure-ether
opened on Aug 8, 2026
Issue body actions

Summary

When a session is open in the TUI and a user message is injected via the HTTP API — POST /session/{id}/prompt_async (with delivery: "steer") or POST /session/{id}/message — neither the injected user turn nor the assistant's reply is rendered in the TUI. The conversation appears frozen from the TUI's point of view.

The data layer is fine: GET /session/{id}/message shows both the injected user message and the assistant reply with correct content. The turn is persisted and processed server-side; it just never shows up in the TUI.

This is a re-report of the same symptom from #8564 and #26671, both of which were auto-closed without a confirmed fix. Per the auto-close note on #26671 ("If the issue is still relevant please open a new one"), and because I can still reproduce it on the current release, here's a fresh report.

Environment

  • OpenCode version: v1.18.15
  • OS: Linux (x86_64)
  • Terminal: TUI via opencode serve + opencode (or opencode attach)
  • Server: default local HTTP server
  • API used: POST /session/{id}/prompt_async (delivery=steer) and POST /session/{id}/message

Steps to reproduce

  1. Start a server and attach the TUI to a session:

    opencode serve --port 4096 &
    opencode --port 4096

    Note the active session id from the TUI footer, or:

    curl -s http://127.0.0.1:4096/session
  2. From a second shell, inject a message into that session with delivery: "steer":

    curl -s -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 the external API (steer)"}],
        "delivery": "steer"
      }'
  3. (Alternative repro via the sync endpoint) POST the same message through /session/{id}/message:

    curl -s -X POST http://127.0.0.1:4096/session/<SESSION_ID>/message \
      -H 'Content-Type: application/json' \
      -d '{
        "parts": [{"type": "text", "text": "hello from the external API (sync)"}]
      }'
  4. Verify the messages were persisted and processed server-side:

    curl -s http://127.0.0.1:4096/session/<SESSION_ID>/message | python3 -m json.tool

    Both the injected user message and the assistant reply are present, with correct role/content.

  5. Look at the TUI while step 2–3 run (and for a while after). The injected user turn and the assistant's reply never appear.

Expected behavior

The injected user turn and the assistant's reply render in the TUI just like locally typed messages — appearing live (or shortly after) while the TUI is attached, regardless of which HTTP client originated the prompt.

Actual behavior

  • The TUI shows nothing for the injected turn: no user message, no assistant reply, no streaming output.
  • GET /session/{id}/message returns both messages with correct data (see evidence below).
  • Messages typed directly in the TUI afterwards work normally. (I have not yet verified whether a TUI restart / reattach backfills the missing turns.)

Evidence: message data is intact

Real message flow from my session (ids/timestamps verbatim from GET /session/{id}/message; text truncated). An external watcher process injected a completion report via prompt_async + delivery: "steer" while the TUI was attached:

[
  {
    "id": "msg_fe1dd6223001C1vEG63ljyoQKO",
    "role": "user",
    "time": { "created": 1786200810019 },
    "parts": [{ "type": "text", "text": "[bgagent j12 返回]喵 status=done turn=1 model=zen/deepseek-v4-flash ..." }]
  },
  {
    "id": "msg_fe1dd6242001CLAMygF4C74Dlw",
    "role": "assistant",
    "time": { "created": 1786200810050, "completed": 1786200833219 },
    "parts": [{ "type": "text", "text": "试车报告收到,9/10,全链路绿灯 ..." }]
  }
]

The server processed the prompt (assistant turn exists), persisted everything, and the read API returns it. The TUI simply does not display these two messages while attached: the conversation view jumps from the message before the injection straight to the next locally-typed user message. The human user only discovered the gap when comparing the API flow against their screen.

Notes

  • delivery: "steer" and delivery: "queue" are the two supported delivery modes (packages/schema/src/session-delivery.ts). The repro above uses steer into a session with an active turn; I have not isolated the queue path for this report.
  • Related context:
    • TUI doesn't render messages from prompt_async endpoint #8564 — TUI doesn't render messages from prompt_async endpoint (auto-closed, unverified)
    • [BUG]: TUI does not live-render messages when prompt is POSTed externally via /session/{id}/prompt_async #26671 — TUI does not live-render externally POSTed prompts (auto-closed; candidate fix PR fix(tui): scope events by project #26936 merged but never confirmed by the reporter)
    • V2 TUI: follow-up prompts should render optimistically #34766 — V2 TUI: follow-up prompts should render optimistically (closed)
    • promptAsync message persisted but session loop never scheduled — async wake prompts to idle session silently dropped #32010 — promptAsync message persisted but session loop never scheduled (related async-path issue)
    • Web UI does not list sessions and cannot start agent while TUI, attach and mobile work correctly #40809 — web UI session list not rendering (adjacent, different symptom — web UI renders fine here)

Activity

  1. github-actions
    assigned
    simonklee
    on Aug 8, 2026
  2. azure-ether
    changed the title [-][Bug]: Externally injected prompt (POST /session/{id}/prompt_async with delivery=steer, or /session/{id}/message) not rendered in TUI — message data intact in GET /session/{id}/message[/-] [+][Bug]: Externally injected prompt (POST) not rendered in TUI while message data intact in GET[/+] on Aug 8, 2026
  3. azure-ether
    changed the title [-][Bug]: Externally injected prompt (POST) not rendered in TUI while message data intact in GET[/-] [+][Bug]: Externally injected prompt (by POST) not rendered in TUI while message data intact in GET[/+] on Aug 8, 2026
  4. azure-ether commented on Aug 8, 2026

    @azure-ether
    azure-ether
    on Aug 8, 2026
    Author
    More actions

    Closing this for now: right after filing I found the behavior is less consistent than reported — in a freshly attached TUI the assistant's reply to the injected turn does render (the injected user turn still never does). I want a few more days of usage to pin down a reliable repro before taking maintainers' time. Will reopen or file fresh with better data.

  5. azure-ether
    closed this as completedon Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @simonklee
    simonklee

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

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.