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:
- Add shouldUseMicroCacheForData() helper with duplicate size checks (band-aid)
- Trust the policy engine - remove redundant code paths that ignored policy decisions (proper fix)
- Increase MicroCache budget
- 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
libs/libs-foundational/storage-system/src/core/engine/gg-storage.ts
🔗 Related
- Decision ID:
dev_1767827351861_00uhp4m - Session: 22
- Workspace: editor2
Auto-generated by MCP Smart Consolidation