Repository navigation
Description
Issue Summary
When the chat.message hook injects text into output.parts (e.g., via output.parts.unshift(...)), the modified content does not appear in the OpenCode TUI when using oh-my-opencode. This affects any plugin that modifies output.parts in the chat.message hook.
Steps to Reproduce
- Install oh-my-opencode plugin
- Create a simple plugin that injects into
chat.message:"chat.message": async (_input, output) => { output.parts.unshift({ type: "text", text: "Breadcrumb line" }); }
- Add plugin to
opencode.jsonalongsideoh-my-opencode - Start OpenCode with that config
- Submit a prompt
- Observe: the breadcrumb line does NOT appear in the TUI
- Observe: the hook IS being called (verified via console logging)
Expected Behavior
When output.parts.unshift(...) is called in the chat.message hook, the injected text should appear at the top of the chat message in the TUI, similar to how Claude Code hooks inject messages.
Actual Behavior
The text added to output.parts is NOT visible in the OpenCode TUI. The hook executes successfully (verified via console logs), but the UI does not render the modified output.parts.
Environment Details
- OpenCode version: 1.0.150+
- oh-my-opencode version: v2.14.0
- Platform: macOS (darwin)
- Reproduction case: Using local plugin in
~/.config/opencode/plugin/*/with oh-my-opencode loaded
Additional Context
The opencode-breadcrumb plugin works correctly when oh-my-opencode is NOT loaded (verified with regular opencode.json). When both plugins are loaded, oh-my-opencode may be processing output.parts after other plugins have already mutated it, potentially overriding or hiding the changes.
Proposed Solution
Either:
-
Support
chat.messagehook mutations: Ensure that plugins modifyingoutput.partsinchat.messagehook have their changes reflected in the TUI, or document the expected behavior (e.g., "mods to parts may not be visible when other plugins are loaded"). -
Add a dedicated hook point for message prefix injection that runs after all plugins have had a chance to process
output.parts, similar to howexperimental.chat.messages.transformworks but at the message render stage. -
Document plugin interaction order: If plugins modify
output.partsinchat.message, specify which order they should be evaluated in and how conflicts should be resolved.
Related
This affects the opencode-breadcrumb plugin and any other plugin that injects into chat.message → output.parts.
Activity
code-yeongyu commentedon Feb 7, 2026
Not our bug — OpenCode TUI rendering issue. When plugin modifies
output.partsinchat.messagehook, the hook executes (verified via logs) but OpenCode TUI doesn't render the changes. Closing.