gemini-cli PR fixes safeJsonStringify mislabeling shared non-circular references as [Circular]
bitwizard25 · ghdev · 2026-11-30
A community PR (#30551) to google-gemini/gemini-cli fixes a subtle bug in safeJsonStringify: the old code tracked every visited object in a global WeakSet without backtracking, so shared non-circular references — like OpenTelemetry's reused endTime arrays and shared histogram boundaries — got serialized as "[Circular]".
The fix replaces the global WeakSet with an ancestor stack in the JSON.stringify replacer that pops back to the current container before cycle checks. Shared DAG references now serialize normally while true cycles still render as [Circular]. The PR includes unit tests covering shared-reference and mixed cycle cases (10/10 passing) plus clean eslint/prettier runs.
More from coding & agent
- 14 Paid AI Tools and Their Free Alternatives: From Claude Code to Cursor to Midjourney — alifcoder · 2026-11-30
- Viral open-source AI browser Xplor adds BYOAI control as Arc sunsets on Dec 22, 2026 — Daniel_Farinax · 2026-11-30
- NotebookLM launches API and MCP, turning your knowledge base into an agent-accessible brain — xiaohu · 2026-11-30
- Running Opus via third-party harnesses costs less than Claude Code, dev finds — Spare_Suit3701 · 2026-11-30
- Reddit thread: which MCP servers quietly became daily workflow essentials — fofofzr · 2026-11-30
- CosyWorld: open-source persistent AI MUD runs dialogue on a local Qwen 1B model — max_paperclips · 2026-11-30