ductor icon indicating copy to clipboard operation
ductor copied to clipboard

[Bug]: Gemini model list is wiped and remains empty if dynamic discovery fails

Open liuh886 opened this issue 8 months ago • 1 comments

What happened?

When starting ductor, the GeminiCacheObserver performs a forced refresh. If the underlying CLI discovery returns no models (e.g., in some Docker environments or during transient errors), the system calls set_gemini_models with an empty list. This overwrites gemini_models.json, leaving the /model menu empty for Gemini.

Steps to Reproduce

  1. /model
  2. Select Gemini
  3. No model available
Image

Expected Behavior

There should be a set of hardcoded default models (including auto, gemini-2.5-pro, etc.) to act as a fallback.

If dynamic discovery returns zero results, it should NOT overwrite a non-empty existing cache unless explicitly forced.

Operating System

Windows

Environment

Docker

Which LLM provider?

Gemini

ductor version

0.12.0

/diagnose output


Relevant log output


LLM self-diagnosis (optional)

No response

Additional context

No response

Before submitting

  • [x] I have searched existing issues for duplicates.
  • [x] I am running the latest version.

liuh886 avatar Mar 07 '26 19:03 liuh886

Fixed in 213b437. Three-tier fallback in BaseModelCache:

  1. Preserve existing non-empty disk cache when discovery fails
  2. Hardcoded fallback models (in-memory only, never persisted) as last resort
  3. Empty sets never overwrite existing model lists

Covers both Codex (with thinking levels / supported_efforts) and Gemini. See PR #35 comment for the full picture.

PleasePrompto avatar Mar 08 '26 03:03 PleasePrompto