gemini-cli - 💡(How to fix) Fix Code generation inserts new parameters in the middle of existing function signatures, breaking all callers

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Code Example

def send_message(agentToolNames, middlewareNames, skillNames, modelName, subagentModelName, thinkEnabled)

---

def send_message(agentToolNames, pdfFormToolNames, middlewareNames, skillNames, modelName, subagentModelName, thinkEnabled)

---

middlewareNames ← receives skillNames
skillNames      ← receives modelName
modelName       ← receives subagentModelName
subagentModel   ← receives thinkEnabled (false)

---

> /about
# paste output here
RAW_BUFFERClick to expand / collapse

What happened?

Title: Code generation inserts new parameters in the middle of existing function signatures, breaking all callers

Description: When asked to add a new parameter to an existing function, Gemini CLI inserts it between existing positional arguments instead of appending it to the end. Since all existing callers use positional arguments, every subsequent parameter shifts by one position.

Example: Original signature:

def send_message(agentToolNames, middlewareNames, skillNames, modelName, subagentModelName, thinkEnabled)

Requested: Add pdfFormToolNames as a new parameter.

Gemini output:

def send_message(agentToolNames, pdfFormToolNames, middlewareNames, skillNames, modelName, subagentModelName, thinkEnabled)

Result — all existing callers now pass wrong values:

middlewareNames ← receives skillNames
skillNames      ← receives modelName
modelName       ← receives subagentModelName
subagentModel   ← receives thinkEnabled (false)

This caused Pydantic validation errors across the entire chat system (false is not a string, 128000 is not a boolean).

Expected behavior: New optional parameters are appended to the end of the signature to preserve backward compatibility with all existing callers.

Project context: FastAPI + LangChain + React, ~40,000 lines. The instruction explicitly stated to append the parameter to the end.

Impact: Critical — entire frontend non-functional until manually corrected.


I am no longer using Gemini CLI for production work. These issues are documented here for the benefit of other developers and the Gemini engineering team.

What did you expect to happen?

Nothing

Client information

<details> <summary>Client Information</summary>

Run gemini to enter the interactive CLI, then run the /about command.

> /about
# paste output here
</details>

Login information

No response

Anything else we need to know?

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING