Bug
Plugins loaded via opencode.json "plugin" array run in the same Bun process as OpenCode. When plugins (or their dependencies) call console.log, console.warn, or console.error, the output goes directly to stdout/stderr, corrupting the TUI display.
The logLevel config option only controls OpenCode's own slog-based logging — it has no effect on plugin console output.
Affected plugins (examples)
@rehydra/opencode — its dependency rehydra calls console.warn("Validation warnings:", ...) on every anonymization pass (upstream issue)
- Custom
.opencode/plugins/*.js — any plugin using console.log for debugging spams the TUI
Screenshot

Raw { c, Validation warnings:, and [memorix] hook fired: lines mixed into the TUI output, making it unreadable.
Expected behavior
Plugin console.* output should either:
- Be intercepted and routed through OpenCode's structured
Log system (respecting logLevel)
- Be suppressed by default with an opt-in
pluginLogLevel config
- Be redirected to a log file rather than stdout
Root cause
In packages/opencode/src/plugin/index.ts, plugins are loaded via import(plugin) and their init functions are called directly. There's no console interception — plugins share the global console object with the TUI process.
Suggested fix
Wrap plugin initialization and hook execution with a console override that routes through the Log system:
function withPluginConsole<T>(pluginName: string, fn: () => T): T {
const original = { ...console }
const pluginLog = Log.create({ service: `plugin:${pluginName}` })
console.log = (...args) => pluginLog.info(args.map(String).join(" "))
console.warn = (...args) => pluginLog.warn(args.map(String).join(" "))
console.error = (...args) => pluginLog.error(args.map(String).join(" "))
try {
return fn()
} finally {
Object.assign(console, original)
}
}
This keeps plugin logging visible in OpenCode's log system while preventing stdout corruption.
Environment
- OpenCode 1.3.0
- macOS 15.5
- Bun 1.2.x
Bug
Plugins loaded via
opencode.json"plugin"array run in the same Bun process as OpenCode. When plugins (or their dependencies) callconsole.log,console.warn, orconsole.error, the output goes directly to stdout/stderr, corrupting the TUI display.The
logLevelconfig option only controls OpenCode's ownslog-based logging — it has no effect on plugin console output.Affected plugins (examples)
@rehydra/opencode— its dependencyrehydracallsconsole.warn("Validation warnings:", ...)on every anonymization pass (upstream issue).opencode/plugins/*.js— any plugin usingconsole.logfor debugging spams the TUIScreenshot
Raw
{ c,Validation warnings:, and[memorix] hook fired:lines mixed into the TUI output, making it unreadable.Expected behavior
Plugin
console.*output should either:Logsystem (respectinglogLevel)pluginLogLevelconfigRoot cause
In
packages/opencode/src/plugin/index.ts, plugins are loaded viaimport(plugin)and their init functions are called directly. There's no console interception — plugins share the globalconsoleobject with the TUI process.Suggested fix
Wrap plugin initialization and hook execution with a
consoleoverride that routes through theLogsystem:This keeps plugin logging visible in OpenCode's log system while preventing stdout corruption.
Environment