Gemini CLI PR fixes safeJsonStringify: shared references wrongly serialized as [Circular]

zero-dot7 · ghdev · 2026-10-04

A PR in google-gemini/gemini-cli fixes a subtle bug in safeJsonStringify: a single global WeakSet used to detect cycles misclassified shared (non-circular) references — like OTel endTime objects — as [Circular]. The fix tracks only the current DFS path, adding keys before serializing a subtree and removing them after, so true cycles still render as [Circular] while diamond references serialize normally. Ships with regression tests, a sabotage check (reverting the fix fails tests), and 11/11 + 69/69 test passes.

Original post →

More from coding & agent

coding & agent channel →