Skip to content

Dashboard model switch clears authProfileOverride, causing API auth failure #81837

@oottlee

Description

@oottlee

Bug Description

When switching models via the Dashboard (Control UI), the sessions.patch RPC call does not pass profileOverride to applyModelOverrideToSessionEntry. This causes the auth profile override to be cleared even though the model/provider override is correctly set.

Root Cause

In sessions-patch-Cuwt3qoX.js, the model switch code:

applyModelOverrideToSessionEntry({
    entry: next,
    selection: { provider, model, isDefault },
    markLiveSwitchPending: true
    // Missing: profileOverride and profileOverrideSource
});

In model-overrides-CYZx2Rwc.js, applyModelOverrideToSessionEntry:

if (profileOverride) {
    entry.authProfileOverride = profileOverride;
    entry.authProfileOverrideSource = profileOverrideSource;
} else {
    // Clears auth profile when profileOverride is not provided!
    delete entry.authProfileOverride;
    delete entry.authProfileOverrideSource;
}

Result

  1. User switches model to provider-A/model-X via Dashboard
  2. providerOverride and modelOverride are set correctly
  3. authProfileOverride is cleared (no profileOverride passed)
  4. Gateway tries to auto-resolve auth for provider-A → fails or resolves incorrectly
  5. API request fails → system falls back to a different provider
  6. Fallback result is persisted to session state, overriding the user selection

Contrast with /model Command

The /model slash command goes through a different code path that correctly sets authProfileOverride. This is why switching via Feishu /model works but Dashboard switching fails.

Suggested Fix

In sessions-patch, when resolving the model override, also resolve and pass the appropriate profileOverride and profileOverrideSource to applyModelOverrideToSessionEntry.

Environment

  • OpenClaw version: 2026.5.7
  • Provider: mimoplan (token-plan-cn.xiaomimimo.com)
  • Model: mimo-v2.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions