Skip to content

Route BusClient fallback warnings to app.log + toast instead of console.warn #153

@four-bytes-robby

Description

@four-bytes-robby

Problem

BusClient.connect() in @four-bytes/opencode-plugin-lib logs fallback warnings to console.warn, bypassing opencode's app.log. The brain plugin sees "Go bus not available" on stderr, not in app.log.

Root Cause

bus-client.ts connect() uses console.warn directly — no logger injection point. It also swallows the error internally (returns MemoryBusClient), so the caller's .catch() never fires.

Solution

  1. In opencode-plugin-lib: Add optional onWarn callback to BusClient.connect() — replaces console.warn
  2. In four-opencode-brain:
    • Pass _client.app.log-based logger to BusClient.connect()
    • Show a toast when MemoryBusClient fallback is used (bus.activePort === 0)

Related

  • Library: @four-bytes/opencode-plugin-lib src/bus-client.ts
  • Brain: src/status.ts getBus() function

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions