Skip to content

[FIX] logger.ts outputs to console in plugin mode — breaks TUI #172

Description

@four-bytes-robby

Problem

logger.ts outputs to console.log/console.warn/console.error even when running in plugin mode (when _logClient is set via setLogClient()). The logger already sends structured logs via _logClient.app?.log() — the console output is a redundant second channel that breaks the terminal UI.

Rule

Per plugin conventions: **console.log/console.warn/console.error is ONLY valid for the initial plugin startup message** (key === "init"). All other logging MUST go through _client?.app?.log() exclusively when in plugin mode. Console output breaks the opencode terminal UI.

Fix

In src/logger.ts:

  1. When _logClient is set (plugin mode): skip console output for ALL messages except the startup "init" message
  2. When _logClient is NOT set (CLI mode / testing): console output is fine (current behavior)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions