You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
server: v2 removed /tui/append-prompt — external clients can no longer pre-fill the TUI input #54681
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
Start opencode v2 (TUI + background service).
Read the service URL/password from ~/.local/state/opencode/service.json.
Call the v1 route: curl -u opencode:$PASSWORD -X POST "$URL/tui/append-prompt" -d '{"text":"hello"}'
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.
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.
Activity
opencode-agent commentedon Oct 12, 2026
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-promptdid.In v2 the TUI still handles an internal
tui.prompt.appendevent, 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-promptroute.Related work:
tui.prompt.append.ui.prompt.append()to the TUI plugin API.Those cover plugins rather than external HTTP clients, so I've kept this open as a separate request. Maintainers will consider it.
MartyMcFlyInTheSky commentedon Oct 15, 2026
Yes I have the same problem. I hope this comes back soon :)