Skip to content

fix: use client.app.log() instead of console.error for plugin logging #26 follow-up #27

Description

@four-bytes-robby

Problem

PR #26 added the console logging rule to AGENTS.md but the plugin code (src/four-opencode-knowledge.ts) still uses console.error for non-startup messages:

  • Line 21: console.error(\DB at ${dbPath}`)— should useclient.app.log()`
  • Line 322: console.error(\ready`)— should useclient.app.log()`

Line 11 (v${pkg.version} loading…) is the compliant initial startup message.

Additionally, AGENTS.md uses _client?.app?.log() instead of client.app.log().

Both CodeRabbit and cubic flagged this in the PR #26 review.

Fix

  1. AGENTS.md: _client?.app?.log()client.app.log()
  2. Plugin: Add client destructuring, create log helper, replace 2 console.error calls

Reference

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