Gemini CLI PR fixes bug where 'text' in part check wrote literal 'undefined' into prompts
DZH166 · ghdev · 2026-11-24
- Bug: appendToLastTextPart() in gemini-cli used 'text' in lastPart to decide whether appended text can merge into the last prompt part. Since Part.text is optional in the @google/genai schema, parts created via object spread or JSON.parse can carry a text key with undefined/null, causing the literal string undefined to be interpolated into the prompt sent to the model.
- Affected path: argumentProcessor.ts for custom slash commands, so the model would receive undefined\n\n<command args> as the argument block.
- Evidence: every other read of text in the module already guards the type (partToString, isTextPart, historyHardening.ts, etc.); this was the only unconditional merge.
- Fix: a one-line change replacing the in check with the existing isTextPart() guard; non-string text parts are now treated like any non-text part, and appended text becomes a new part.
More from coding & agent
- Inkling 2 Mini: a 26B looped transformer, plus Songe trains your local model while you sleep — iamrobotbear · 2026-11-24
- Same JSON prompt, three tools: Claude vs ChatGPT vs Figma Make build a food delivery app — Tegadesigns · 2026-11-24
- Canva launches MCP server, opening its design engine to any AI agent — basedjensen · 2026-11-24
- Cognition co-founder: nearly all their code is written by Devin, some devs use iPads — Madisonkanna · 2026-11-24
- Elicit cofounder: pharma firms don't evaluate AI systems, webinar on evaluating agent swarms — elicitorg · 2026-11-24
- LangChain open-sources Content Studio, a Slack-prompted design agent for videos and decks — LangChain · 2026-11-24