Repository navigation
Description
What happens
The prompt outline / Prompts pane / wmux prompts is always empty for an OpenCode pane. Not "missing some" — nothing ever lands, for any pane, on any OpenCode version.
Why: it is never collected
The prompt log (src/renderer/utils/prompt-log.ts) has exactly two producers, and neither can see a prompt typed inside an agent TUI:
- OSC 133 shell marks — the shell integration's A/B/C sequence. Once
opencodeowns the screen there are no shell prompts to mark. UserPromptSubmithook events —App.tsxturns{event: 'UserPromptSubmit', prompt}into arecordAgentPromptcall. The only thing that ever sends that event isresources/cli/wmux-hook.js, which is registered in Claude Code'ssettings.json(claude-context.ts) and Grok's hooks (grok-context.ts).git grep UserPromptSubmiton master shows no other producer.
The OpenCode integration is a different mechanism entirely — resources/opencode-plugin/wmux.js, installed to ~/.config/opencode/plugin/. It sends PostToolUse, report-agent --blocked/--unblocked, agent-activity, and the session handle; it has no handler for user-message submission at all. In the v1 half, WmuxPlugin's returned hooks object has no chat.message entry; in setupV2, register(...) is called for tool.execute.before/after and shell.create.before only; the string prompt appears in the file once, in a comment about permission prompts.
So this is not a regression and not a broken wire: the prompt-log feature (issue #207) was built for hook-driven agents and OpenCode's plugin half was never taught to report prompts. Everything downstream already works — main fans hook.event params out to every window verbatim, and the renderer consumes UserPromptSubmit today (it is also what ends a "Needs you" the moment a user replies, via agent-hook-bridge.ts).
Fix direction
OpenCode v2's plugin API has a prompt-admission hook made for exactly this — ctx.session.hook("prompt", (event) => …) runs for incoming user prompts (docs: "Intercept incoming user prompts before attachment and skill resolution and durable inbox admission"; synthetic messages, shell messages, compaction and move controls are excluded).
- Plugin: register
session.promptinsetupV2(guarded like the existing registrations), readevent.prompt.text, cap it at the same 4000 charswmux-hook.jsuses (MAX_PROMPT), dedupe by message id — the docs note prompt hooks are retry-safe but not exactly-once — and callwmux(["hook", "--event", "UserPromptSubmit", "--prompt", text]). - CLI:
cmdHookaccepts--promptand rides it throughhook.event;COMMAND_SPECS.hookgrows the flag. The renderer side needs nothing. - Bump the plugin version marker so installed copies update.
- v1
chat.messagecould feed the same event later; scoping this to v2 only.
Known limitation, same as the session handle (docs "Session handle for restore"): on v2's shared opencode serve --service, the plugin's WMUX_SURFACE_ID names only the pane that started the server, so prompts from other panes on that server would be attributed to it. That is the existing behaviour of every server-side signal, and the documented reason a CLI-side half (the #290 follow-up) is the eventual answer for remote/shared setups.
Environment
wmux 2.28.1 (master 3d59aef), OpenCode v2.
Activity
amirlehmam commentedon Oct 19, 2026
Fixed by #305, released in v2.29.0. The OpenCode v2 plugin (marker 8, reinstalled automatically) registers the prompt-admission hook, so submitted prompts now fill the outline, the Prompts pane and
wmux prompts. v1 is unchanged, and the sharedserve --servicecaveat still applies.feat(opencode): report submitted prompts to the prompt log (amirlehma…
feat(opencode): TUI half reports user prompts via session.inbox.enque…
feat(opencode): TUI half reports user prompts via session.inbox.enque…