google-gemini / google-gemini/gemini-cli

Session summary generation ignores configured model and hardcodes gemini-3.1-flash-lite, causing failures on custom endpoints

Open
#29,065 2 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?

Environment
- @google/gemini-cli version: 0.56.0
- Node.js: v22.17.0
- OS: Windows 11 (win32)
- Configured model: gemini-3.1-pro-preview
- API endpoint: custom proxy (OpenAI/new-api compatible relay with model-routing "groups", group name cocos)

Description

I configured gemini-3.1-pro-preview as my model. Normal chat requests use this model correctly. However, when gemini-cli tries to generate a background session summary, it silently switches to gemini-3.1-flash-lite instead of the configured model. My proxy's cocos group has no channel/distributor for gemini-3.1-flash-lite, so every summary attempt fails with a model_not_found 503 error, retries 4+ times with backoff, and spams the terminal with stack traces.

Steps to reproduce
1. Set model to gemini-3.1-pro-preview via /model (or config), pointed at a custom API base URL that only exposes specific models per routing group.
2. Use the CLI normally until a session summary is triggered (e.g., on /model switch, compaction, or session end — whichever triggers generateAndSaveSummary).
3. Observe the summary generation request goes to gemini-3.1-flash-lite, not the configured model.

### What did you expect to happen?

Session summary generation should use the currently configured/active model (or at minimum, a model the user has explicitly made available), not a hardcoded lite model that may not exist on the user's endpoint.

### Client information

Client Information

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

```console
> /about
│ About Gemini CLI │
│ │
│ CLI Version 0.56.0 │
│ Git Commit b6e23a7dc │
│ Model gemini-3.1-pro-preview │
│ Sandbox no sandbox │
│ OS win32 │
│ Auth Method gemini-api-key
```

### Login information

Attempt 5 failed: {"error":{"code":"model_not_found","message":"分组 cocos 下模型 gemini-3.1-flash-lite 无可用渠道(distributor) (request id: 202608250246317784272508xxxxxxx)","type":"new_api_error"}}. Max attempts reached

### Anything else we need to know?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by searching for the generateAndSaveSummary entry point and trace how it selects a model versus the configured active model. Verify the summary request uses the configured model on custom endpoints and no longer fails because of an unavailable hardcoded model; the issue names no specific file or test.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.