google-gemini / google-gemini/gemini-cli

Gemini CLI sends duplicate results for completed shell tool calls

Open
#28,004 7 comments 0 reactions 0 assignees View on GitHub
area/agent kind/bug priority/p2 status/bot-triaged
Dominant language
TypeScript
Stars
107k
Forks
14.6k
Avg merge
2d 3h
Merged PRs (30d)
45

Description

### What happened?

A deterministic Gemini-compatible provider can cause Gemini CLI to send repeated tool results for completed shell tool calls. The standalone reproduction verifies duplicate tool-result submission after a controlled follow-up tool-use sequence.

Local repeat-3 validation reproduced duplicate tool-result submission on all three runs. The public standalone reproducer checks the same behavior without requiring any private harness or prebuilt target image.

### What did you expect to happen?

Gemini CLI should send at most one tool result for each provider-issued tool-call ID. A completed tool call should not be reported again after its result has already been sent back to the provider.

### Client information

Client Information

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

```console
Package: @google/gemini-cli
Affected version checked locally: 0.46.0
Current npm latest checked on 2026-06-17: 0.46.0
Upstream repository: https://github.com/google-gemini/gemini-cli
Platform: Linux x86_64 in Docker (node:24-bookworm)
Interface: CLI
```

### Login information

API key flow against a local Gemini-compatible mock endpoint. The reproduction uses a fake API key and makes no live Gemini request.

### Anything else we need to know?

### Standalone reproduction

Prerequisites: Docker, Python 3, and the GitHub CLI (`gh`) for the clone command below. The linked reproducer is self-contained and uses only Python standard-library modules plus Docker. It builds the affected CLI version from the public upstream package/release source and starts a local mock provider; it does not require this repository or any private fuzzing harness. The Docker run is limited to 2 CPUs and 4 GiB RAM by default.

Complete self-contained reproducer: https://gist.github.com/N0zoM1z0/ca09d9da157373a3c8f7863cdd9dc5a1

The Gist contains `gemini-cli-duplicate-tool-result-reexecution.reproduce.py`. Download and run:

```bash
gh gist clone ca09d9da157373a3c8f7863cdd9dc5a1 gemini-cli-duplicate-tool-result-reexecution-reproducer
cd gemini-cli-duplicate-tool-result-reexecution-reproducer
python3 gemini-cli-duplicate-tool-result-reexecution.reproduce.py
```

To reuse an already-built local image:

```bash
python3 gemini-cli-duplicate-tool-result-reexecution.reproduce.py --skip-build
```

Key output from a local run against the affected version:

```text
REPRODUCED
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.