gemini-cli PR fixes context compression: one >64KB screenshot exhausted exempt retrieval budget
bitwizard25 · ghdev · 2026-11-26
PR #30473 in google-gemini/gemini-cli fixes a budget-accounting bug in the context chat compression service.
- Root cause: collapseOlderFunctionResponses evicts binary payloads from older turns, but measured candidate turns with calculateHistoryByteSize, which still counted evicted bytes. A single >64KB screenshot readfile could exhaust the entire 64KB MAXEXEMPTRETRIEVALHISTORYBYTES budget, collapsing earlier text readfile/grep outputs to 2KB previews.
- Fix: A new calculateRetainedTurnByteSize helper counts only retained bytes for the exempt-budget loop, leaving full-size measurement for memory-pressure thresholds untouched.
- Tests: Parameterized regression tests covering nested and sibling inlineData layouts fail on main and pass with the fix; 38/38 and 18/18 tests pass.
More from coding & agent
- After 3 years solo: Pyramid, an encrypted long-term memory system for personal AI agents — Promptmethus · 2026-12-06
- Raw logs + SQL search may beat specialized agent memory layers, Hatchery argues — Antique_Atmosphere97 · 2026-12-06
- DevOps engineer explores building AI agents for cross-cloud job monitoring — Shashank_r_ · 2026-12-06
- Qwen4-35B-A3B 4-bit release: fine-tune on a single 22GB GPU via CQ quantizer — textclf · 2026-12-06
- Dual RTX 8000 rig benchmarks 4 local LLMs: Qwen4-35B-A3B hits 15/15 planted bugs at 77 t/s — AggressiveManager450 · 2026-12-06
- Open-source Surface Fleck rendering binds pixels to 3D model surfaces to stop pixel shimmer — Promptmethus · 2026-12-06