Refactor: What's the proper fix for MicroCache 'Entry too large' warni...

Documentation for Sessions

♻️ Refactor: What's the proper fix for MicroCache 'Entry too large' warni...

📋 Decision Context

Question:

What's the proper fix for MicroCache 'Entry too large' warning spam?

Task: Refactor initial MicroCache fix to be simpler and trust the policy engine


🎯 Decision Made

Chosen:

Trust the policy engine - it already does size checks. Remove redundant helper, delete the buggy 'cache update after write' code path that was ignoring policy decisions entirely.

Options Considered:

  1. Add shouldUseMicroCacheForData() helper with duplicate size checks (band-aid)
  2. Trust the policy engine - remove redundant code paths that ignored policy decisions (proper fix)
  3. Increase MicroCache budget
  4. Add compression

💭 Reasoning

The policy engine in policy-engine.ts already checks: (1) size < 8KB (isSmall), (2) key type is critical/user-preference, (3) strategy === 'speed' for micro-cache target, (4) isSmall for redundancy.localStorage. The bug was that lines 465-471 in gg-storage.ts were writing ALL successful non-flash writes to micro-cache, completely ignoring the policy decision. The proper fix is to delete that code path and trust the policy engine's decision. Added !shouldUseMicroCache check to redundancy path to avoid double writes.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation