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
Add TUI display-only chat text transform hook (string→string) #11864
The TUI chat markdown output can sometimes be difficult to read depending on the content (e.g., long tables, deeply nested lists, or excessive whitespace). Currently, there is no mechanism for plugins to intercept and transform this text specifically for display purposes without affecting persistence or the Web UI.
Proposal
Add a new stable plugin hook (e.g., chat.display.transform) with a string -> string signature. This hook will allow plugins to perform display-only transformations on chat text before it is rendered in the TUI.
Scope & Constraints
TUI only: Initial implementation targets the TUI TextPart component.
Display-only: Transformations are transient and not persisted to the session history.
No Web UI / File Viewer changes: This hook specifically targets chat message rendering.
Timing Modes
To balance performance and UX, the hook should support three timing modes (configurable via opencode.json with CLI overrides):
final: Apply only once the message is complete.
throttle: Apply on streaming updates but throttled (default 100ms).
chunk: Apply on every streaming update (raw).
Safety & Reliability
Sync-only: Prevents async plugins from blocking the render loop.
Error Fallback: If a plugin throws or returns a non-string, the system logs the error and falls back to the original (or last successful) text, continuing the chain.
Deterministic Ordering: Hooks run in the sequence plugins are defined in the config.
Acceptance Criteria
New hook type added to plugin definitions.
TUI rendering wired at the TextPart chokepoint.
Configuration keys and CLI flags added for mode and throttle control.
Unit tests for multi-plugin ordering and error fallback.
Activity
github-actions commentedon Feb 3, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case or if you're proposing something distinct from TUI rendering customization.
github-actions commentedon Apr 4, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.