OpenCode plugin: console.log spam pollutes TUI input area
Problem
The OpenCode plugin file (.opencode/plugins/memorix.js) contains console.log calls that output directly to the OpenCode TUI, polluting the area near the input field on every tool execution:
[memorix] plugin loaded, directory: /Users/...
[memorix] hook fired: tool.execute.after
[memorix] hook fired: tool.execute.after
[memorix] hook fired: tool.execute.after
This fires on every single tool call, making the TUI unusable during active sessions.
Root Cause
The generated plugin template (pre-v1.0.3) included debug-level console.log calls:
- Line 11:
console.log('[memorix] plugin loaded, directory:', directory);— on session start - Line 22:
console.log('[memorix] hook fired:', payload.hook_event_name);— on every hook fire - Line 24:
console.log('[memorix] hook error:', err?.message ?? err);— on errors (should beconsole.error)
OpenCode's plugin runtime routes plugin console.log output to the TUI status area. The logLevel config setting only controls Go-level slog, not JS plugin console output, so there's no way to suppress these messages via configuration.
Current State
The generateOpenCodePlugin() function in src/hooks/installers/index.ts has already been fixed on main — it produces a silent template with catch {}. However:
- The static file
.opencode/plugins/memorix.jsin the repo root still has the old noisy version - Users who installed hooks with v1.0.3 or earlier still have the noisy file locally and need to reinstall hooks or manually remove the
console.logcalls
Suggested Fix
- Update
.opencode/plugins/memorix.jsto match the output ofgenerateOpenCodePlugin() - Consider adding a note in release notes that users should run
memorix hooks install --agent opencodeto regenerate the plugin
Thanks for reporting this — I confirmed the OpenCode TUI pollution is a real issue. The static .opencode/plugins/memorix.js file in the repo is still on the older noisy version, even though the generator had already moved in the right direction.
I'm reviewing PR #17 now. The console.log cleanup is the correct fix, but I'm asking for a small scope adjustment before merge so we only land the log-spam fix without changing session lifecycle behavior in the compaction prompt.
Appreciate the clear report and reproduction details.
@AVIDS2 let's celebrate my first contribution to the project! 🥳