openclaw - ✅(Solved) Fix Runtime model selection skips slash-form aliases and can fail cron jobs with Unknown model [1 pull requests, 2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#73573Fetched 2026-04-29 06:18:04
View on GitHub
Comments
2
Participants
3
Timeline
4
Reactions
0
Timeline (top)
commented ×2closed ×1cross-referenced ×1

OpenClaw allows configured model aliases that themselves contain /, and openclaw models list shows them as aliases. But runtime model selection only checked the alias index for inputs without /. As a result, values like xiaomi/mimo-v2-pro-mit bypass alias lookup, get parsed as real provider/model refs, and can fail at runtime with Unknown model: xiaomi/mimo-v2-pro-mit.

Error Message

FailoverError: Unknown model: xiaomi/mimo-v2-pro-mit

Root Cause

resolveModelRefFromString() only checked aliasIndex.byAlias when the input did not contain /.

That makes slash-form aliases display correctly in config/model listing, but fail to resolve during runtime selection.

Fix Action

Fixed

PR fix notes

PR #73575: fix: resolve slash-form model aliases before provider parsing

Description (problem / solution / changelog)

Summary

  • resolve slash-form model aliases before provider/model parsing
  • let runtime selection map values like xiaomi/mimo-v2-pro-mit back to configured canonical refs such as openai/xiaomi/mimo-v2-pro-mit
  • add focused regression coverage for both resolveAllowedModelRef and resolveModelRefFromString

Problem

OpenClaw currently allows configured aliases that themselves contain /, and openclaw models list shows them as aliases. But runtime model selection only checked the alias index for inputs without /. As a result, values like xiaomi/mimo-v2-pro-mit bypassed alias lookup, were parsed as real provider/model refs, and could fail at runtime with Unknown model: xiaomi/mimo-v2-pro-mit.

Fixes #73573.

Validation

  • pnpm test src/agents/model-selection.test.ts
  • pnpm test src/agents/pi-embedded-runner/model.forward-compat.errors-and-overrides.test.ts

Changed files

  • src/agents/model-selection-shared.ts (modified, +4/-6)
  • src/agents/model-selection.test.ts (modified, +53/-0)

Code Example

{
  "agents": {
    "defaults": {
      "model": {
        "primary": "openai/xiaomi/mimo-v2-pro-mit",
        "fallbacks": []
      },
      "models": {
        "openai/xiaomi/mimo-v2-pro-mit": {
          "alias": "xiaomi/mimo-v2-pro-mit"
        }
      }
    }
  }
}

---

{
  "payload": {
    "kind": "agentTurn",
    "model": "xiaomi/mimo-v2-pro-mit"
  }
}

---

FailoverError: Unknown model: xiaomi/mimo-v2-pro-mit
RAW_BUFFERClick to expand / collapse

Summary

OpenClaw allows configured model aliases that themselves contain /, and openclaw models list shows them as aliases. But runtime model selection only checked the alias index for inputs without /. As a result, values like xiaomi/mimo-v2-pro-mit bypass alias lookup, get parsed as real provider/model refs, and can fail at runtime with Unknown model: xiaomi/mimo-v2-pro-mit.

Reproduction

Use a config like:

{
  "agents": {
    "defaults": {
      "model": {
        "primary": "openai/xiaomi/mimo-v2-pro-mit",
        "fallbacks": []
      },
      "models": {
        "openai/xiaomi/mimo-v2-pro-mit": {
          "alias": "xiaomi/mimo-v2-pro-mit"
        }
      }
    }
  }
}

Then set a cron job payload model to the slash-form alias:

{
  "payload": {
    "kind": "agentTurn",
    "model": "xiaomi/mimo-v2-pro-mit"
  }
}

Trigger the cron job.

Expected behavior

xiaomi/mimo-v2-pro-mit should resolve through the configured alias map and run as the canonical ref:

  • openai/xiaomi/mimo-v2-pro-mit

Actual behavior

The runtime skips alias resolution because the input contains /, parses it as:

  • provider = "xiaomi"
  • model = "mimo-v2-pro-mit"

and can fail with:

FailoverError: Unknown model: xiaomi/mimo-v2-pro-mit

Root cause

resolveModelRefFromString() only checked aliasIndex.byAlias when the input did not contain /.

That makes slash-form aliases display correctly in config/model listing, but fail to resolve during runtime selection.

Proposed fix

In resolveModelRefFromString(), always check the alias index first, regardless of whether the input contains /. If there is no alias match, then fall back to normal provider/model parsing.

Validation

Focused regression coverage can be added around:

  • resolveModelRefFromString("xiaomi/mimo-v2-pro-mit")
  • resolveAllowedModelRef(... raw: "xiaomi/mimo-v2-pro-mit")

to ensure slash-form aliases resolve to the canonical configured model ref instead of being treated as a real provider/model pair.

extent analysis

TL;DR

The most likely fix is to modify the resolveModelRefFromString() function to always check the alias index first, regardless of whether the input contains a /.

Guidance

  • Review the resolveModelRefFromString() function to ensure it checks the alias index before attempting to parse the input as a provider/model reference.
  • Verify that the function correctly handles inputs with / by testing with examples like xiaomi/mimo-v2-pro-mit.
  • Add regression tests around resolveModelRefFromString("xiaomi/mimo-v2-pro-mit") and resolveAllowedModelRef(... raw: "xiaomi/mimo-v2-pro-mit") to ensure slash-form aliases resolve correctly.
  • Consider updating the documentation for resolveModelRefFromString() to reflect the expected behavior for inputs with /.

Example

function resolveModelRefFromString(input) {
  // Always check the alias index first
  const aliasMatch = aliasIndex.byAlias[input];
  if (aliasMatch) {
    return aliasMatch;
  }
  // Fall back to normal provider/model parsing
  const parts = input.split('/');
  if (parts.length === 2) {
    const provider = parts[0];
    const model = parts[1];
    // Attempt to resolve the provider/model reference
  } else {
    // Handle invalid input
  }
}

Notes

The proposed fix assumes that the aliasIndex.byAlias object is correctly populated with the configured aliases. If this is not the case, additional changes may be necessary to ensure that the alias index is updated correctly.

Recommendation

Apply the proposed fix to the resolveModelRefFromString() function to ensure that slash-form aliases are correctly resolved during runtime selection. This change should resolve the issue without introducing any significant regressions.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

xiaomi/mimo-v2-pro-mit should resolve through the configured alias map and run as the canonical ref:

  • openai/xiaomi/mimo-v2-pro-mit

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix Runtime model selection skips slash-form aliases and can fail cron jobs with Unknown model [1 pull requests, 2 comments, 3 participants]