gemini-cli - 💡(How to fix) Fix bug(core): redundant parallel tool calls due to wait_for_previous default [1 pull requests]

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…

Root Cause

Root Cause: This is an interaction between the parallel tool scheduler and recent system prompt changes that push for "turn efficiency".

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

What happened?

Agents are frequently making redundant, nearly identical tool calls in parallel (e.g., executing the same search or issuing the same file edit multiple times concurrently).

What did you expect to happen?

Tools should either be deduplicated if they are identical, or the default execution mode should be sequential so the agent can learn from the first tool call before deciding if a second one is necessary.

Client information

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

Gemini CLI v0.41.2 Platform: All

</details>

Anything else we need to know?

Root Cause: This is an interaction between the parallel tool scheduler and recent system prompt changes that push for "turn efficiency".

  1. Commit cd7dced95 implemented the parallel scheduler, introducing wait_for_previous to tool schemas. It defaults to parallel execution (i.e., wait_for_previous defaults to false when omitted by the model).
  2. Commit c17400b83 updated system prompts to aggressively encourage making multiple tool calls in a single turn to save turns.

Because models frequently "over-sample" or generate redundant function calls within a single step to cover their bases, and they usually omit the wait_for_previous parameter, the scheduler executes all of these redundant calls immediately in parallel.

Proposed Fix: Reverse the default behavior in the Scheduler (packages/core/src/scheduler/scheduler.ts). If the wait_for_previous flag is omitted, default it to true (sequential execution). This aligns with the model's natural assumption of sequential execution while preserving the ability to run in parallel if the model explicitly sets wait_for_previous: false.

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