Skip to content

fix: replace remaining console.error/warn/log with structured logging in TUI#823

Open
MrRealORG wants to merge 1 commit into
XiaomiMiMo:mainfrom
MrRealORG:fix/auto-0616-tui-console-cleanup
Open

fix: replace remaining console.error/warn/log with structured logging in TUI#823
MrRealORG wants to merge 1 commit into
XiaomiMiMo:mainfrom
MrRealORG:fix/auto-0616-tui-console-cleanup

Conversation

@MrRealORG

Copy link
Copy Markdown

Summary

Replace 10 remaining console.* calls in TUI code with structured logging via Log.create(). console.* calls break TUI terminal rendering by writing raw text to stdout/stderr.

Changes

File Calls Change
app.tsx 2 console.errorlog.warn (clipboard copy failure, plugin load failure)
context/kv.tsx 3 console.errorlog.warn (KV state read/write failures)
component/prompt/index.tsx 1 console.loglog.warn (session create failure)
plugin/runtime.ts 3 Removed redundant console.error/console.warn (structured log.error/log.warn already present on the same lines)
plugin/slots.tsx 1 console.errorlog.error (plugin error handler)

Files Modified

  • packages/opencode/src/cli/cmd/tui/app.tsx
  • packages/opencode/src/cli/cmd/tui/context/kv.tsx
  • packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx
  • packages/opencode/src/cli/cmd/tui/plugin/runtime.ts
  • packages/opencode/src/cli/cmd/tui/plugin/slots.tsx

Notes

… in TUI

console.* calls break TUI terminal rendering by writing raw text to
stdout/stderr. Replace them with Log.create() structured logging.

- app.tsx: 2 console.error → log.warn (clipboard copy, plugin load)
- context/kv.tsx: 3 console.error → log.warn (read/write KV state)
- component/prompt/index.tsx: 1 console.log → log.warn (session create)
- plugin/runtime.ts: 3 console.error/warn → removed (already logged
  via structured log.error/log.warn — these were redundant duplicates)
- plugin/slots.tsx: 1 console.error → log.error (plugin error)

Total: 10 console.* calls replaced/removed across 5 files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant