google-gemini / google-gemini/gemini-cli

Unexpected model resolution: gemini-2.5-flash is mapped to gemini-3.5-flash

Open
#29,213 6 comments 0 reactions 0 assignees View on GitHub
area/core effort/small 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?

# `--model gemini-2.5-flash` is resolved to `gemini-3.5-flash` when using Vertex AI

## Summary

When invoking Gemini CLI with `--model gemini-2.5-flash`, the CLI appears to resolve the request to `gemini-3.5-flash` instead of the specified model.

As a result, the request fails because my Vertex AI project does not have access to `gemini-3.5-flash`.

## Environment

- Gemini CLI version: **0.58.0**
- Also reproduced on: **0.54.0**
- Node.js: **v24.13.0**
- Authentication: **Vertex AI (ADC)**

## Reproduction

Run:

```bash
echo "hello" | gemini \
--model gemini-2.5-flash \
--prompt ""
```

## Actual Behavior

The request fails with the following error:

```text
Error when talking to Gemini API

ModelNotFoundError: Publisher model
`projects/.../locations/us-central1/publishers/google/models/gemini-3.5-flash`
was not found or your project does not have access to it.
```

Although `gemini-2.5-flash` was specified, the CLI appears to send the request to `gemini-3.5-flash`.

## Expected Behavior

The CLI should send the request to `gemini-2.5-flash` when it is explicitly specified with:

```bash
--model gemini-2.5-flash
```

It should not resolve or rewrite the model name to `gemini-3.5-flash`.

## Additional Information

Using the same environment and authentication, the following command works as expected:

```bash
echo "hello" | gemini \
--model gemini-2.5-pro \
--prompt ""
```

### What did you expect to happen?

It should not resolve or rewrite the model name to `gemini-3.5-flash`.

### Client information

Client Information

Run on Linux

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

```console
> /about
│ About Gemini CLI │
│ │
│ CLI Version 0.54.0 │
│ Git Commit a74b483d1 │
│ Model gemini-2.5-pro │
│ Sandbox no sandbox │
│ OS linux │
│ Auth Method vertex-ai │
│ GCP Project *** │
│ IDE Client VS Code │

```

### Login information

_No response_

### Anything else we need to know?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the provided `gemini --model gemini-2.5-flash --prompt ""` command under Vertex AI authentication, then trace the CLI's model-resolution path. Done means an explicit `gemini-2.5-flash` request reaches that model rather than `gemini-3.5-flash`, while the existing `gemini-2.5-pro` behavior remains working.

Written by the indexing model from the issue text.

Assessment

Tech stack
google-cloud, typescript
Domain
ai, cli, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.