Skip to content

fix: gate debug recommendation filter log behind shouldInject - #279

Open
ranxianglei wants to merge 1 commit into
masterfrom
2026-08-05_debug-nudge-log-noise
Open

fix: gate debug recommendation filter log behind shouldInject#279
ranxianglei wants to merge 1 commit into
masterfrom
2026-08-05_debug-nudge-log-noise

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Problem

When config.debug: true, the recommendation filter logger.debug fired on EVERY message transform hook call — even when no nudge was being injected. In normal sessions with compressible ranges (almost always), this produced a log entry per message. The user saw constant [ACP Debug] Recommendation filter: entries and toast notifications even when there was nothing to compress.

Fix

Moved the recommendation filter logger.debug from its per-turn position (before shouldInject decision) to inside the shouldInject block. Now only fires when a nudge is actually being injected — i.e., when there is real compression to recommend.

Verification

  • TypeScript: 0 errors
  • Tests: 954 pass, 0 fail
  • Build: 386.83 KB
  • Deployed locally

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