openclaw - ✅(Solved) Fix [Bug]: Direct provider names inconsistency (Eg. 'moonshot' should be 'moonshotai' to match OpenRouter slug convention) [1 pull requests, 1 comments, 2 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#73876Fetched 2026-04-29 06:13:48
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×2commented ×1cross-referenced ×1referenced ×1

The direct Moonshot AI provider is named moonshot in openclaw, but OpenRouter (and Moonshot AI's own branding) uses moonshotai as the organization slug. This creates a confusing and inconsistent naming mismatch for users who configure both direct and OpenRouter access.

Error Message

Failure: model specified as moonshotai/kimi-k2.6 (OpenRouter naming)

error diagnostic lane task error: lane=cron-nested durationMs=26043 error="FailoverError: Unknown model: moonshotai/kimi-k2.6"

warn model-fallback Model "moonshotai/kimi-k2.6" not found. Fell back to "openrouter/minimax/minimax-m2.7".

Stale plugin warning (repeated on every restart/reload):

warn Config warnings: - plugins.entries.moonshotai: plugin not found: moonshotai (stale config entry ignored; remove it from plugins config)

Success: after wizard resolved correct name

info gateway agent model: moonshot/kimi-k2.6

Wizard auto-enabling correct provider:

info gateway gateway: auto-enabled plugins: - moonshot/kimi-k2.6 model configured, enabled automatically. openclaw version: 2026.4.26

Root Cause

The direct Moonshot AI provider is named moonshot in openclaw, but OpenRouter (and Moonshot AI's own branding) uses moonshotai as the organization slug. This creates a confusing and inconsistent naming mismatch for users who configure both direct and OpenRouter access.

Fix Action

Fixed

PR fix notes

PR #73934: fix(providers): accept moonshotai as alias for direct moonshot provider (#73876)

Description (problem / solution / changelog)

Fixes #73876.

Problem

OpenRouter's catalog and Moonshot AI's own branding both use the `moonshotai` org slug (e.g. `moonshotai/kimi-k2.6` is what users see at openrouter.ai). openclaw's direct Moonshot provider is registered as `moonshot`, so users who copy the model ref from OpenRouter without the `openrouter/` prefix hit `Unknown model: moonshotai/kimi-k2.6` despite having a working direct Moonshot API key.

The bug-report author (jimdawdy-hub) cites the existing `xiaomi/mimo-v2-flash` ↔ `openrouter/xiaomi/mimo-v2-flash` symmetry as the desired contract: direct provider names should match OpenRouter org slugs; the `openrouter/` prefix should act as a clean scope operator.

Fix

Add `moonshotai` and `moonshot-ai` to the `normalizeProviderId` alias list so they resolve to the canonical `moonshot` provider id, matching the existing alias pattern used for `qwencloud` → `qwen`, `z.ai` → `zai`, `kimi-code` → `kimi`, etc.

Existing `moonshot/<model>` configs, auth profiles, plugin id (`moonshot`), and docs are entirely unchanged. The fix is purely a normalization expansion.

Why this shape over the alternatives

  • vs. renaming the provider to `moonshotai`: would break every existing `moonshot/` config, auth profile, manifest plugin id, and docs reference. The alias path is backward-compatible by construction.
  • vs. a separate `PROVIDER_ALIASES` map: `normalizeProviderId` already encodes 5 alias families (qwen/zai/opencode/kimi/bedrock/volcengine) inline. Following the established pattern keeps the surface coherent.

Tests

Added `src/agents/provider-id.test.ts` — the first dedicated unit test for `normalizeProviderId` / `findNormalizedProviderValue`. 14 cases:

  • All existing aliases (qwen, zai, kimi, bedrock, volcengine) — guards against regressions
  • New moonshotai / moonshot-ai mappings (3 case-variant tests)
  • Canonical `moonshot` preserved (no double-aliasing)
  • `findNormalizedProviderValue` matching alias keys against canonical entries and vice versa

``` pnpm vitest run src/agents/provider-id.test.ts → 14 passed (all new)

pnpm vitest run src/agents/model-ref-shared.test.ts \ src/agents/model-selection.test.ts \ src/agents/provider-id.test.ts → 222 passed (208 pre-existing + 14 new, no regressions) ```

End-to-end trace: `parseStaticModelRef` (model-ref-shared.ts:56) calls `normalizeProviderId` on the provider segment of the slash-form ref, so `moonshotai/kimi-k2.6` → `moonshot/kimi-k2.6` flows through the entire resolution path.

🦞 lobster-biscuit


Sign-Off: hclsys

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • src/agents/provider-id.test.ts (added, +79/-0)
  • src/agents/provider-id.ts (modified, +8/-0)

Code Example

# Failure: model specified as moonshotai/kimi-k2.6 (OpenRouter naming)
error  diagnostic  lane task error: lane=cron-nested durationMs=26043
       error="FailoverError: Unknown model: moonshotai/kimi-k2.6"

warn   model-fallback  Model "moonshotai/kimi-k2.6" not found.
       Fell back to "openrouter/minimax/minimax-m2.7".

# Stale plugin warning (repeated on every restart/reload):
warn   Config warnings:
       - plugins.entries.moonshotai: plugin not found: moonshotai
         (stale config entry ignored; remove it from plugins config)

# Success: after wizard resolved correct name
info   gateway  agent model: moonshot/kimi-k2.6

# Wizard auto-enabling correct provider:
info   gateway  gateway: auto-enabled plugins:
                - moonshot/kimi-k2.6 model configured, enabled automatically.
openclaw version: 2026.4.26
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

The direct Moonshot AI provider is named moonshot in openclaw, but OpenRouter (and Moonshot AI's own branding) uses moonshotai as the organization slug. This creates a confusing and inconsistent naming mismatch for users who configure both direct and OpenRouter access.

Steps to reproduce

  1. Browse OpenRouter's model catalog — Kimi K2 is listed as moonshotai/kimi-k2.6
  2. Configure openclaw to use kimi as the primary model by specifying moonshotai/kimi-k2.6 (the string you see on 3. OpenRouter, without the openrouter/ prefix)
  3. Observe that openclaw fails with Unknown model: moonshotai/kimi-k2.6 The working direct-API form is actually moonshot/kimi-k2.6

Expected behavior

Direct provider names should match OpenRouter's organization slugs. The openrouter/ prefix should act as a clean scope operator, meaning:

moonshotai/kimi-k2.6 → direct Moonshot API (user's own key) openrouter/moonshotai/kimi-k2.6 → routed via OpenRouter This convention already works correctly for xiaomi:

xiaomi/mimo-v2-flash → direct Xiaomi API ✓ openrouter/xiaomi/mimo-v2-flash → via OpenRouter ✓

Actual behavior

The direct Moonshot provider is named moonshot instead of moonshotai, breaking the convention that works for every other provider. Users who copy moonshotai/kimi-k2.6 from OpenRouter's UI and attempt to use it as a direct provider get a cryptic "Unknown model" error with no hint that the correct name is moonshot/kimi-k2.6.

OpenClaw version

2026.4.26

Operating system

EndeavourOS Titan

Install method

npm

Model

Kimi-2.6

Provider / routing chain

User configures: moonshotai/kimi-k2.6 (copied from OpenRouter UI) ↓ openclaw model resolver: "Unknown model: moonshotai/kimi-k2.6" ↓ fallback chain triggered → openrouter/minimax/minimax-m2.7 Intended path (after discovering correct name via wizard): moonshot/kimi-k2.6 → auth profile: moonshot:default (api_key mode) → provider: moonshot → baseUrl: https://api.moonshot.ai/v1 → direct Moonshot AI API (no OpenRouter involvement) Equivalent working path for reference: xiaomi/mimo-v2-flash → auth profile: xiaomi:default (api_key mode) → provider: xiaomi → baseUrl: https://api.xiaomimimo.com/v1

Additional provider/model setup details

Auth profiles involved: moonshot:default (provider: moonshot, mode: api_key). No per-agent overrides. Provider definition in models.providers.moonshot with api: openai-completions. The moonshotai plugin entry (added manually by user following OpenRouter naming) generates a repeated config warning on every gateway start/reload: plugins.entries.moonshotai: plugin not found: moonshotai (stale config entry ignored). The onboarding wizard (openclaw onboard) correctly resolves to moonshot/kimi-k2.6 during initial setup, meaning users who run the wizard are unaffected — only users who configure models manually after onboarding hit this.

Logs, screenshots, and evidence

# Failure: model specified as moonshotai/kimi-k2.6 (OpenRouter naming)
error  diagnostic  lane task error: lane=cron-nested durationMs=26043
       error="FailoverError: Unknown model: moonshotai/kimi-k2.6"

warn   model-fallback  Model "moonshotai/kimi-k2.6" not found.
       Fell back to "openrouter/minimax/minimax-m2.7".

# Stale plugin warning (repeated on every restart/reload):
warn   Config warnings:
       - plugins.entries.moonshotai: plugin not found: moonshotai
         (stale config entry ignored; remove it from plugins config)

# Success: after wizard resolved correct name
info   gateway  agent model: moonshot/kimi-k2.6

# Wizard auto-enabling correct provider:
info   gateway  gateway: auto-enabled plugins:
                - moonshot/kimi-k2.6 model configured, enabled automatically.
openclaw version: 2026.4.26

Impact and severity

Affected users: Any user who configures kimi/Moonshot AI models manually (rather than exclusively through the onboarding wizard) — specifically users who reference the model ID from OpenRouter's model browser or documentation, where it is displayed as moonshotai/kimi-k2.6

Severity: Blocks workflow — the model silently fails and falls back to a different provider, consuming fallback quota and potentially using a paid OpenRouter model when the user intended to use their free direct Moonshot API key

Frequency: Always reproducible when the model is specified as moonshotai/kimi-k2.6 without the openrouter/ prefix

Consequence: Silent wrong-model execution (user believes they are on kimi direct but the fallback runs on minimax via OpenRouter), unnecessary rate-limit pressure on fallback models, and repeated noisy config warnings on every gateway restart once a user adds the moonshotai plugin entry following the logical-but-wrong naming assumption

Additional information

Suggested fix

Rename the internal provider from moonshot to moonshotai Add a migration alias so existing configs using moonshot/... continue to work (with an optional deprecation warning) Update any documentation or wizard-generated configs that reference moonshot/ Additional context

Discovered while debugging model fallback issues. The openclaw onboarding wizard correctly resolved this to moonshot/kimi-k2.6 during setup, but users who configure models manually after the fact (e.g., adding kimi as a fallback by copying the model ID from OpenRouter's website) will hit this inconsistency every time.

The inconsistency is specific to this one provider — all other direct providers observed use naming that matches OpenRouter's slugs (e.g., xiaomi/mimo-v2-flash works correctly as both the direct provider name and the OpenRouter sub-path). The moonshot vs moonshotai divergence appears to be a historical naming choice that predates or diverged from OpenRouter's slug convention for this provider. No regression context available — cannot confirm a version where moonshotai/ worked as a direct provider name.

extent analysis

TL;DR

Rename the internal Moonshot provider from moonshot to moonshotai to fix the naming inconsistency.

Guidance

  • Update the internal provider name to match OpenRouter's organization slug (moonshotai) for consistency.
  • Implement a migration alias to ensure existing configs using moonshot/ continue to work, possibly with a deprecation warning.
  • Review and update documentation and wizard-generated configs to reference the new provider name (moonshotai/).
  • Verify that the fix resolves the "Unknown model" error and allows manual configuration of Moonshot AI models using the correct provider name.

Example

No code snippet is provided as the issue is related to configuration and naming consistency.

Notes

The suggested fix assumes that renaming the internal provider and implementing a migration alias will resolve the issue without introducing regressions. However, thorough testing is necessary to confirm the fix.

Recommendation

Apply the workaround by renaming the internal provider to moonshotai and implementing a migration alias to ensure backwards compatibility. This change will provide a consistent naming convention and resolve the "Unknown model" error for manual configurations.

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

Direct provider names should match OpenRouter's organization slugs. The openrouter/ prefix should act as a clean scope operator, meaning:

moonshotai/kimi-k2.6 → direct Moonshot API (user's own key) openrouter/moonshotai/kimi-k2.6 → routed via OpenRouter This convention already works correctly for xiaomi:

xiaomi/mimo-v2-flash → direct Xiaomi API ✓ openrouter/xiaomi/mimo-v2-flash → via OpenRouter ✓

Still need to ship something?

×6

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

Back to top recommendations

TRENDING