fix: remove dead code, replace remaining console.* with structured logging in TUI#857
Open
MrRealORG wants to merge 1 commit into
Open
Conversation
…th structured logging in TUI - Delete packages/opencode/src/util/scrap.ts (zero imports, dead code) - Replace console.error/warn/log with Log.Default.* in: - cli/cmd/tui/app.tsx (clipboard copy, plugin loading) - cli/cmd/tui/context/kv.tsx (read/write KV state) - cli/cmd/tui/plugin/slots.tsx (plugin error handler) - cli/cmd/tui/util/clipboard.ts (platform detection debug logs) - Remove duplicate console.error/warn in plugin/runtime.ts (already uses structured log)
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
Removes dead code and replaces remaining raw
console.error/console.log/console.warncalls with structured logging (Log.Default.*) across 5 TUI files, and removes duplicateconsole.*calls in the plugin runtime that were already logging via the structuredLogutility.Changes (6 files)
packages/opencode/src/util/scrap.ts— Deleted. Zero imports anywhere in the codebase; contained only placeholder stub exports (foo,bar,dummyFunction,randomHelper).packages/opencode/src/cli/cmd/tui/app.tsx— AddedLogimport from@/util. Replaced 2console.errorcalls (clipboard copy failure, TUI plugin loading failure) withLog.Default.warn/Log.Default.error.packages/opencode/src/cli/cmd/tui/context/kv.tsx— AddedLogimport. Replaced 3console.errorcalls (KV state read/write failures) withLog.Default.error.packages/opencode/src/cli/cmd/tui/plugin/slots.tsx— AddedLogimport. Replaced 1console.error(plugin slot error handler) withLog.Default.error.packages/opencode/src/cli/cmd/tui/util/clipboard.ts— AddedLogimport. Replaced 6console.logcalls (platform-specific clipboard method selection) withLog.Default.debug— these are informational debug messages, not errors.packages/opencode/src/cli/cmd/tui/plugin/runtime.ts— Removed 3 duplicateconsole.error/console.warncalls that were already paired with structuredlog.error/log.warncalls. The structured logging was already in place; the raw console calls were redundant.