Skip to content

server: v2 removed /tui/append-prompt — external clients can no longer pre-fill the TUI input #54681

Open

Description

@yangxr1995

Summary

OpenCode v1 exposed TUI control endpoints, notably POST /tui/append-prompt
("Append prompt to the TUI", used by editor integrations to insert context
references like path/to/file.lua:L10-L20 into the prompt input so the user can
edit before sending). v2.0.26 removed all /tui/* routes without a replacement,
so external clients have no supported way to pre-fill the TUI input box without
immediately sending a prompt.

Environment

  • opencode version: 2.0.26
  • OS: Linux 6.6.87.2-microsoft-standard-WSL2 (x64)
  • Terminal: xterm-256color, panes managed by zellij 0.44.3
  • Shell: zsh
  • Install/channel: release (opencode.ai installer)
  • Active plugins: none relevant (the affected integration is the third-party
    editor plugin nickjvandyke/opencode.nvim connecting via service.json)

Reproduction

  1. Start opencode v2 (TUI + background service).
  2. Read the service URL/password from ~/.local/state/opencode/service.json.
  3. Call the v1 route: curl -u opencode:$PASSWORD -X POST "$URL/tui/append-prompt" -d '{"text":"hello"}'
  4. Check the running server's own spec: curl -u opencode:$PASSWORD "$URL/openapi.json" | grep -i tui

Expected Behavior

A supported v2 way for external clients to append text to the connected TUI's
input without sending — e.g. POST /api/tui/append-prompt (or a session-scoped
equivalent) that forwards the text to the foreground TUI client over the event
stream, restoring v1's client.tui.appendPrompt capability.

Actual Behavior

  • The running server's GET /openapi.json lists 116 routes; none are TUI
    control routes.
  • POST /tui/append-prompt returns 405 — but so does POST to any
    non-existent path (the SPA catch-all), and GET /tui/append-prompt returns
    the web UI HTML, i.e. the route does not exist.
  • POST /api/session/{sessionID}/prompt always sends immediately; the prompt
    input is client-local state with no server-side API to touch it in v2.

Additional Context

  • v1 reference: client.tui.appendPrompt → POST /tui/append-prompt
    (sst/opencode-sdk-js, -python, -go, TuiAppendPromptParams).
  • Current workaround in opencode.nvim (verified working but fragile): locate
    the TUI process via /proc (cmdline opencode + cwd match), read
    ZELLIJ_SESSION_NAME/ZELLIJ_PANE_ID from its environ, then inject
    keystrokes with zellij action write-chars -p <pane> "<ref>"; or
    chansend() when the TUI runs inside an nvim embedded terminal. This is
    multiplexer-specific and impossible for TUIs in plain external terminals.
  • Issue is deterministic, not intermittent.

Activity

  1. opencode-agent commented on Oct 12, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed write-up, @yangxr1995! You're asking for v2 to bring back a supported HTTP way for external clients, such as editor plugins like opencode.nvim, to append text to the running TUI's input without sending it, as v1's POST /tui/append-prompt did.

    In v2 the TUI still handles an internal tui.prompt.append event, but no server route publishes it, so external clients can't trigger it right now. Our own VS Code extension also still calls the old /tui/append-prompt route.

    Related work:

    Those cover plugins rather than external HTTP clients, so I've kept this open as a separate request. Maintainers will consider it.

  2. MartyMcFlyInTheSky commented on Oct 15, 2026

    @MartyMcFlyInTheSky

    Yes I have the same problem. I hope this comes back soon :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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