Skip to content

Scheduled token refresh writes status to stderr by default #517

@nxtkofi

Description

@nxtkofi

Summary

The background token refresh scheduler currently writes an unconditional status line to stderr whenever an immediate scheduled refresh runs:

[token_refresh] scheduled refresh (immediate) ok=false

In TUI clients such as OpenCode via opencode-with-claude, that stderr output can appear over the interactive input line, interrupting typing.

Source

src/proxy/tokenRefresh.ts logs the event through claudeLog("token_refresh.scheduled", { ok, immediate: true }), then also writes the human-readable line with console.error(...).

Expected behavior

Scheduled refresh telemetry should stay behind the existing debug logging path, or otherwise avoid writing to stderr by default.

Actual behavior

The default scheduler path writes to stderr even without debug logging enabled.

Reproduction context

Observed with:

  • opencode-with-claude@1.6.11
  • @rynfar/meridian@1.42.1
  • OpenCode TUI
  • multiple Meridian profiles configured

A local hotfix removing the unconditional console.error stops the input-line pollution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions