fix: replace remaining console.error/warn/log with structured logging in TUI#823
Open
MrRealORG wants to merge 1 commit into
Open
fix: replace remaining console.error/warn/log with structured logging in TUI#823MrRealORG wants to merge 1 commit into
MrRealORG wants to merge 1 commit into
Conversation
… 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace 10 remaining
console.*calls in TUI code with structured logging viaLog.create().console.*calls break TUI terminal rendering by writing raw text to stdout/stderr.Changes
app.tsxconsole.error→log.warn(clipboard copy failure, plugin load failure)context/kv.tsxconsole.error→log.warn(KV state read/write failures)component/prompt/index.tsxconsole.log→log.warn(session create failure)plugin/runtime.tsconsole.error/console.warn(structuredlog.error/log.warnalready present on the same lines)plugin/slots.tsxconsole.error→log.error(plugin error handler)Files Modified
packages/opencode/src/cli/cmd/tui/app.tsxpackages/opencode/src/cli/cmd/tui/context/kv.tsxpackages/opencode/src/cli/cmd/tui/component/prompt/index.tsxpackages/opencode/src/cli/cmd/tui/plugin/runtime.tspackages/opencode/src/cli/cmd/tui/plugin/slots.tsxNotes
clipboard.tsdebugconsole.logcalls were intentionally left — they fire during one-time method detection before the TUI rendersten_vad_loader.jsis a third-party WASM loader — not modified