Gemini CLI patch fixes a turn-boundary bug that caused 400s after skill calls

adamfweidman · ghdev · 2026-07-29

Gemini CLI fixes a regression that broke skill-triggered follow-up calls

The google-gemini/gemini-cli repo merged a fix for bug #28565: when active loops were detected, the CLI could start from a merged functionResponse + text turn and miss a required synthetic thought signature. That caused the Gemini API to reject the next tool call with 400 INVALIDARGUMENT, leaving a bad turn in history and making the session unrecoverable.

The regression came from #28407, which introduced coalesceConsecutiveRoles. The fix adds the missing check so function-response turns are skipped when finding the active loop, matching the code comment and the API’s real turn boundary. The new regression test fails on main and passes with the patch; the practical repro is: run a prompt, let the model reply, trigger a skill, then send a follow-up.

Original post →

More from coding & agent

coding & agent channel →