Feature hasn't been suggested before.
Describe the enhancement you want to request
opencode 1.15.1 documents tui.prompt.append as a plugin hook for
mutating the outbound prompt before it reaches the model. In the
interactive TUI this is exactly what frameworks need to inject
session-level context (pre-task checklists, project conventions,
guardrails) without the user having to repeat it every turn.
In opencode run (headless mode), the hook is silently inert.
plugin.init fires, but tui.prompt.append never does. Consistent
with the tui.* namespace, fine. But it leaves no documented
headless equivalent for prompt mutation.
Use case: frameworks like Mycelium (theory-grounded agent harness,
https://github.com/haabe/mycelium) want one plugin that injects
pre-task context whether the user is in TUI or running headless via
opencode run from a parent process.
Possible shapes:
- A new event like
session.prompt.append or agent.prompt.before
that fires in both modes.
- A documented promotion of an existing event (
session.created,
agent.start) to cover prompt mutation in headless.
- Explicit docs that no such hook exists and the supported pattern
is config-level system-prompt injection.
The asymmetry between TUI and headless plugin surfaces is worth
calling out in the docs either way, even if the design intent is
"headless agents don't get prompt mutation."
Related: #27813 covers TUI-side projected session hooks; this
request is the headless counterpart. Likely complementary, not
duplicate.
Reproduction:
- Install opencode-ai 1.15.1 locally.
- Create
.opencode/plugin/test.js that registers
tui.prompt.append, appends a token to the prompt, and logs to
a file.
- Run
opencode run "echo your prompt verbatim" and inspect the
log. plugin.init fires; tui.prompt.append does not.
Verified 2026-05-16 with local Ollama provider (no API auth issues)
against llama3.1:8b. Full reproduction context:
https://github.com/haabe/mycelium/blob/main/docs/receipts/cases/2026-05-16-opencode-phase1-runtime.md
Feature hasn't been suggested before.
Describe the enhancement you want to request
opencode 1.15.1 documents
tui.prompt.appendas a plugin hook formutating the outbound prompt before it reaches the model. In the
interactive TUI this is exactly what frameworks need to inject
session-level context (pre-task checklists, project conventions,
guardrails) without the user having to repeat it every turn.
In
opencode run(headless mode), the hook is silently inert.plugin.initfires, buttui.prompt.appendnever does. Consistentwith the
tui.*namespace, fine. But it leaves no documentedheadless equivalent for prompt mutation.
Use case: frameworks like Mycelium (theory-grounded agent harness,
https://github.com/haabe/mycelium) want one plugin that injects
pre-task context whether the user is in TUI or running headless via
opencode runfrom a parent process.Possible shapes:
session.prompt.appendoragent.prompt.beforethat fires in both modes.
session.created,agent.start) to cover prompt mutation in headless.is config-level system-prompt injection.
The asymmetry between TUI and headless plugin surfaces is worth
calling out in the docs either way, even if the design intent is
"headless agents don't get prompt mutation."
Related: #27813 covers TUI-side projected session hooks; this
request is the headless counterpart. Likely complementary, not
duplicate.
Reproduction:
.opencode/plugin/test.jsthat registerstui.prompt.append, appends a token to the prompt, and logs toa file.
opencode run "echo your prompt verbatim"and inspect thelog.
plugin.initfires;tui.prompt.appenddoes not.Verified 2026-05-16 with local Ollama provider (no API auth issues)
against llama3.1:8b. Full reproduction context:
https://github.com/haabe/mycelium/blob/main/docs/receipts/cases/2026-05-16-opencode-phase1-runtime.md