Skip to content

[BUG]Duplicate model_name entries don't fall back correctly — always resolves to second entry, ignores first and third #1153

@YouSummoner

Description

@YouSummoner

Quick Summary

When multiple model_list entries share the same model_name (as implied by the fix(config): allow duplicate model_name for load balancing commit), the first entry is skipped entirely and the second is always used — even when the first model works correctly in isolation. If the second entry fails, it errors out rather than falling through to the third.

Environment & Tools

  • PicoClaw Version: (0.2.0)
  • Go Version: (1.25.7)
  • AI Model & Provider: (Google)
  • Operating System: (Debian Stable)
  • Channels: (Telegram)

📸 Steps to Reproduce

  1. Add three model_list entries with the same model_name,
    e.g.:
    { "model_name": "google", "model": "gemini/gemini-3.1-flash-lite-preview", ... },
    { "model_name": "google", "model": "gemini/gemini-3-flash-preview", ... },
    { "model_name": "google", "model": "gemini/gemini-flash-lite-latest", ... }
  2. Set agents.defaults.model_name to "google"
  3. Send a message — it always hits the second entry
  4. Make the second entry invalid — it errors instead of trying the third

❌ Actual Behavior

  1. First entry is always skipped
  2. Second entry is always used
  3. No fallback to third entry on failure

✅ Expected Behavior

Either round-robin across all matching entries, or try them in order with fallback on failure. The first entry should not be silently skipped.

💬 Additional Context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions