Skip to content

Suppress informational log messages in TUI mode#26

Merged
BYK merged 1 commit intomainfrom
fix/suppress-tui-log-noise
Mar 2, 2026
Merged

Suppress informational log messages in TUI mode#26
BYK merged 1 commit intomainfrom
fix/suppress-tui-log-noise

Conversation

@BYK
Copy link
Owner

@BYK BYK commented Mar 2, 2026

Problem

All lore log messages used console.error() which writes to stderr. The TUI renders stderr as red error text, making routine status messages look like alarming errors to users:

TUI showing red error-looking messages

Examples seen in the wild:

  • [lore] incremental distillation: 54 undistilled messages in ses_3502bf6e2ffe
  • [lore] pruned 9 oversized knowledge entries (confidence set to 0)

Solution

Added src/log.ts with three levels:

Level Visibility Use case
log.info() Suppressed by default Routine operations — distillation, pruning, consolidation, imports
log.warn() Suppressed by default Non-actionable oddities — dropping trailing messages
log.error() Always visible Real failures — catch blocks where something actually broke

Set LORE_DEBUG=1 to see all messages when debugging the plugin.

Changes

  • New: src/log.ts — lightweight logger with LORE_DEBUG gating
  • src/index.ts — 18 console.error calls replaced with appropriate log level
  • src/distillation.ts — 1 console.errorlog.info

All log messages used console.error() which renders as red text in the
TUI, making routine status messages (distillation, pruning, consolidation)
look like errors. This confuses users who don't know if something is wrong.

Add src/log.ts with three levels:
- log.info(): suppressed by default, shown with LORE_DEBUG=1
- log.warn(): suppressed by default, shown with LORE_DEBUG=1
- log.error(): always visible (actual failures)

Replace all console.error() calls with the appropriate level:
- Informational (log.info): imported knowledge, pruned entries,
  incremental distillation, context overflow recovery steps,
  consolidation results, temporal pruning stats
- Warnings (log.warn): dropping trailing assistant messages
- Errors (log.error): import/export failures, distillation errors,
  curator errors, consolidation errors, pruning errors, recovery failures
@BYK BYK enabled auto-merge (squash) March 2, 2026 21:08
@BYK BYK merged commit 251296d into main Mar 2, 2026
1 check passed
@BYK BYK deleted the fix/suppress-tui-log-noise branch March 2, 2026 21:09
@craft-deployer craft-deployer bot mentioned this pull request Mar 2, 2026
2 tasks
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