Skip to content

Session pin to fallback-only model silently removes fallback chain via dedup (fallbackConfigured:false) #77766

Description

@axonrelaybot

Summary

When a session is pinned to a model that only exists in agents.defaults.model.fallbacks (not as primary), the fallback chain is silently reduced to length 1 via deduplication. The result is fallbackConfigured:false in the decision log — the session has no safety net despite a fallback chain being configured globally.

Steps to reproduce

  1. Configure: agents.defaults.model.primary: venice/claude-sonnet-4-6, fallbacks: [openai/gpt-5.5]
  2. Pin the main session to openai/gpt-5.5 (e.g. via model switch)
  3. Trigger a timeout on openai/gpt-5.5

Expected: fallback chain is consulted; at minimum the user gets an error from exhausted fallbacks with options
Actual: fallbackConfigured:false, chain_exhausted after 1 attempt, silent failure

Root cause (traced in source)

model-fallback-Bpl6-0ev.js line 662:

const hasFallbackCandidates = candidates.length > 1;

When effectivePrimary is openai/gpt-5.5 and the configured fallbacks list is [openai/gpt-5.5], the createModelCandidateCollector dedup set (seen) eliminates gpt-5.5 as a fallback candidate because it was already added as the primary. candidates.length === 1hasFallbackCandidates = false.

The fallback inclusion logic (lines 530–545) correctly detects that the effective primary differs from the configured primary and checks whether the effective primary exists in the fallback list — but this check serves to include fallbacks, not to expand them. The dedup step then collapses the list back to 1.

User-facing surprise

Pinning reduces resilience, which is the opposite of user expectation. A user who pins to a fallback model for testing assumes the global fallback chain remains operative.

Proposed fix

When a session pin's effective primary matches a model in the configured fallback list, expand the candidate list with the next-tier fallback (e.g. if the pin is openai/gpt-5.5 and the global fallbacks are [openai/gpt-5.5], include the global primary venice/claude-sonnet-4-6 as a fallback candidate, or at minimum warn that the fallback chain is collapsed).

A simpler mitigation: when candidates.length === 1 and isPrimary && effectivePrimary !== configuredPrimary, add the configured primary as a fallback candidate.

Evidence from logs

model_fallback_decision: decision=candidate_failed
requestedProvider=openai, requestedModel=gpt-5.5
attempt=1, total=1
fallbackConfigured=false
fallbackStepFinalOutcome=chain_exhausted

Version

OpenClaw 2026.5.3-1 (2eae30e), macOS 26.4.1 arm64

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions