Skip to content

fix: remove dead code, replace remaining console.* with structured logging in TUI#857

Open
MrRealORG wants to merge 1 commit into
XiaomiMiMo:mainfrom
MrRealORG:fix/auto-0616-dead-code-logging-cleanup
Open

fix: remove dead code, replace remaining console.* with structured logging in TUI#857
MrRealORG wants to merge 1 commit into
XiaomiMiMo:mainfrom
MrRealORG:fix/auto-0616-dead-code-logging-cleanup

Conversation

@MrRealORG

Copy link
Copy Markdown

Summary

Removes dead code and replaces remaining raw console.error/console.log/console.warn calls with structured logging (Log.Default.*) across 5 TUI files, and removes duplicate console.* calls in the plugin runtime that were already logging via the structured Log utility.

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 — Added Log import from @/util. Replaced 2 console.error calls (clipboard copy failure, TUI plugin loading failure) with Log.Default.warn/Log.Default.error.
  • packages/opencode/src/cli/cmd/tui/context/kv.tsx — Added Log import. Replaced 3 console.error calls (KV state read/write failures) with Log.Default.error.
  • packages/opencode/src/cli/cmd/tui/plugin/slots.tsx — Added Log import. Replaced 1 console.error (plugin slot error handler) with Log.Default.error.
  • packages/opencode/src/cli/cmd/tui/util/clipboard.ts — Added Log import. Replaced 6 console.log calls (platform-specific clipboard method selection) with Log.Default.debug — these are informational debug messages, not errors.
  • packages/opencode/src/cli/cmd/tui/plugin/runtime.ts — Removed 3 duplicate console.error/console.warn calls that were already paired with structured log.error/log.warn calls. The structured logging was already in place; the raw console calls were redundant.

…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)
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