Repository navigation
tui output corrupted when using plugins #6830
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentuiThis relates to changes in v1.0, now that opencode uses opentui
Description
Description
When using plugins - e.g. my own git-worktree here - I see plugin output polluting the TUI.
- This goes away when I resize the terminal itself (Ghostty version
1c2db85aa- nightly build) - It is reproducible 100% of the time - just re-invoke the plugin via prompt.
- How can I get TUI logs or state to share here / investigate further?
plugins all load correctly:
➜ opencode run hey --print-logs
INFO 2026-01-04T13:42:41 +279ms service=default version=0.0.0-dev-202601041317 args=["run","hey","--print-logs"] opencode
INFO 2026-01-04T13:42:41 +1ms service=default directory=/Users/matt/repos/dotfiles creating instance
INFO 2026-01-04T13:42:41 +0ms service=project directory=/Users/matt/repos/dotfiles fromDirectory
INFO 2026-01-04T13:42:41 +28ms service=default directory=/Users/matt/repos/dotfiles bootstrapping
INFO 2026-01-04T13:42:41 +2ms service=config path=/Users/matt/.config/opencode/config.json loading
INFO 2026-01-04T13:42:41 +0ms service=config path=/Users/matt/.config/opencode/opencode.json loading
INFO 2026-01-04T13:42:41 +0ms service=config path=/Users/matt/.config/opencode/opencode.jsonc loading
INFO 2026-01-04T13:42:42 +218ms service=bun cmd=["/Users/matt/.bun/install/global/node_modules/opencode-darwin-arm64/bin/opencode","add","@opencode-ai/plugin@0.0.0-dev-202601041317","--exact"] cwd=/Users/matt/.config/opencode running
INFO 2026-01-04T13:42:42 +17ms service=config path=/Users/matt/repos/dotfiles/.opencode/opencode.jsonc loading
INFO 2026-01-04T13:42:42 +0ms service=config path=/Users/matt/repos/dotfiles/.opencode/opencode.json loading
INFO 2026-01-04T13:42:42 +0ms service=bun cmd=["/Users/matt/.bun/install/global/node_modules/opencode-darwin-arm64/bin/opencode","add","@opencode-ai/plugin@0.0.0-dev-202601041317","--exact"] cwd=/Users/matt/repos/dotfiles/.opencode running
INFO 2026-01-04T13:42:42 +5ms service=plugin path=file:///Users/matt/repos/dotfiles/.opencode/plugin/git-worktree.ts loading plugin
INFO 2026-01-04T13:42:42 +27ms service=plugin path=opencode-copilot-auth@0.0.9 loading plugin
INFO 2026-01-04T13:42:42 +0ms service=bun code=0 stdout=bun add v1.3.5 (1e86cebd)
installed @opencode-ai/plugin@0.0.0-dev-202601041317
[5.00ms] done
stderr=Saved lockfile
done
INFO 2026-01-04T13:42:42 +0ms service=bun cmd=["/Users/matt/.bun/install/global/node_modules/opencode-darwin-arm64/bin/opencode","install"] cwd=/Users/matt/.config/opencode running
INFO 2026-01-04T13:42:42 +1ms service=bun code=0 stdout=bun add v1.3.5 (1e86cebd)
Plugins
git-worktree
OpenCode version
0.0.0-dev-202601041317
Steps to reproduce
- Install/copy over https://github.com/elithrar/dotfiles/blob/main/.config/opencode/plugin/git-worktree.ts
- Run opencode + ask it to create worktrees
- Observe what appears to be polluted TUI rendering?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentuiThis relates to changes in v1.0, now that opencode uses opentui
Activity
github-actions commentedon Jan 4, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
kommander commentedon Jan 4, 2026
When spawning or excuting a command the stdio needs to be captured and handled instead of just inheriting stdio from the parent, which then just writes to stdout, wherever the cursor currently is. You can use console.log then it will land in the dev console, or parse the output and show it in the UI.
rekram1-node commentedon Jan 4, 2026
@elithrar if change this to use the oc sdk logger itll go away as a workaround:
Becomes:
If you prefer u can write to the opencode log files using sdk instead, I suppose we should prolly be capturing this on our end tho and not letting it leak through
elithrar commentedon Jan 4, 2026
TIL! got it - thanks both.
Added a docs PR here to help: #6833
elithrar commentedon Jan 4, 2026
Working on a more comprehensive change in #6852 b/c
ctx.client.app.logisn't available to tools (only plugins)feat: add ctx.log() for custom tools and plugins
fix(tui): remove debug console.log calls leaking into TUI display