claude-code - 💡(How to fix) Fix [BUG] Desktop 1.6259.1 adds model name validation that rejects non-Anthropic model names — breaks third-party gateways

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…

Claude Desktop 1.6259.1 adds client-side model name validation in Gateway mode that rejects any model name not containing Anthropic-specific keywords (claude, sonnet, opus, haiku, anthropic). This breaks all third-party gateway users with custom model names. The validation did not exist in 1.5354.0.

Error Message

Actual: Error: expected a gateway model route referencing an Anthropic model...

Root Cause

In app.asar.vite/build/index.js, the gateway validation function q5r calls Jte, which checks the model name against:

// Byte offset 6215292 in index.js
const eRt = /^(sonnet|opus|haiku)(-[\d.]+)?$/;

// Byte offset 6215331
const Y5r = ["claude", "sonnet", "opus", "haiku", "anthropic"];

// Byte offset 6216424 — gateway validator
function q5r(e) {
  return Jte(e)
    ? { ok: true }
    : {
        ok: false,
        reason:
          "expected a gateway model route referencing an Anthropic model " +
          "(e.g. claude-sonnet-4-5, anthropic/claude-*). " +
          "Name routes to match the underlying model.",
      };
}

A model name like mimo-v2.5-pro matches neither the regex nor any keyword, so it is rejected.

Fix Action

Fix / Workaround

Workaround (Verified Working)

Why direct patching of app.asar doesn't work: The new app.asar has an Electron integrity check (asar_util.cc:143) that rejects modified archives. The expected hash is not stored in any discoverable file — it appears to be computed or embedded in a way that cannot be updated externally.

Code Example

// Byte offset 6215292 in index.js
const eRt = /^(sonnet|opus|haiku)(-[\d.]+)?$/;

// Byte offset 6215331
const Y5r = ["claude", "sonnet", "opus", "haiku", "anthropic"];

// Byte offset 6216424 — gateway validator
function q5r(e) {
  return Jte(e)
    ? { ok: true }
    : {
        ok: false,
        reason:
          "expected a gateway model route referencing an Anthropic model " +
          "(e.g. claude-sonnet-4-5, anthropic/claude-*). " +
          "Name routes to match the underlying model.",
      };
}

---

{
     "inferenceProvider": "gateway",
     "inferenceGatewayBaseUrl": "https://your-gateway.example.com/anthropic",
     "inferenceGatewayApiKey": "sk-xxx",
     "inferenceModels": [{ "name": "custom-model-v1" }]
   }

---

function q5r(e) {
-  return Jte(e)
-    ? { ok: true }
-    : {
-        ok: false,
-        reason:
-          "expected a gateway model route referencing an Anthropic model " +
-          "(e.g. claude-sonnet-4-5, anthropic/claude-*). " +
-          "Name routes to match the underlying model.",
-      };
+  return { ok: true };
 }

---

function q5r(e) {
+  if (process.env.CLAUDE_CODE_SKIP_MODEL_VALIDATION) return { ok: true };
   return Jte(e) ? { ok: true } : { ok: false, reason: "..." };
 }

---

Copy-Item "$env:LOCALAPPDATA\AnthropicClaude\app-1.5354.0\resources\app.asar" `
          "$env:LOCALAPPDATA\AnthropicClaude\app-1.6259.1\resources\app.asar" -Force

---

$shell = New-Object -ComObject WScript.Shell
$lnk = $shell.CreateShortcut("$env:USERPROFILE\Desktop\Claude.lnk")
$lnk.TargetPath = "$env:LOCALAPPDATA\AnthropicClaude\app-1.6259.1\claude.exe"
$lnk.WorkingDirectory = "$env:LOCALAPPDATA\AnthropicClaude\app-1.6259.1"
$lnk.IconLocation = "$env:LOCALAPPDATA\AnthropicClaude\app-1.6259.1\claude.exe,0"
$lnk.Save()
RAW_BUFFERClick to expand / collapse

Summary

Claude Desktop 1.6259.1 adds client-side model name validation in Gateway mode that rejects any model name not containing Anthropic-specific keywords (claude, sonnet, opus, haiku, anthropic). This breaks all third-party gateway users with custom model names. The validation did not exist in 1.5354.0.

Root Cause

In app.asar.vite/build/index.js, the gateway validation function q5r calls Jte, which checks the model name against:

// Byte offset 6215292 in index.js
const eRt = /^(sonnet|opus|haiku)(-[\d.]+)?$/;

// Byte offset 6215331
const Y5r = ["claude", "sonnet", "opus", "haiku", "anthropic"];

// Byte offset 6216424 — gateway validator
function q5r(e) {
  return Jte(e)
    ? { ok: true }
    : {
        ok: false,
        reason:
          "expected a gateway model route referencing an Anthropic model " +
          "(e.g. claude-sonnet-4-5, anthropic/claude-*). " +
          "Name routes to match the underlying model.",
      };
}

A model name like mimo-v2.5-pro matches neither the regex nor any keyword, so it is rejected.

Steps to Reproduce

  1. Install Claude Desktop (auto-updates to 1.6259.1).
  2. Create a gateway config at %LOCALAPPDATA%\Claude-3p\configLibrary\<uuid>.json:
    {
      "inferenceProvider": "gateway",
      "inferenceGatewayBaseUrl": "https://your-gateway.example.com/anthropic",
      "inferenceGatewayApiKey": "sk-xxx",
      "inferenceModels": [{ "name": "custom-model-v1" }]
    }
  3. Launch Claude Desktop, select custom-model-v1, send any message.

Expected: Message sent through gateway. Actual: Error: expected a gateway model route referencing an Anthropic model...

What Should Happen

Gateway mode should pass through whatever model name the user configured. The gateway is responsible for routing — client-side validation of model names in gateway mode is incorrect behavior.

Proposed Fix

Remove or bypass the q5r validation for gateway connections:

 function q5r(e) {
-  return Jte(e)
-    ? { ok: true }
-    : {
-        ok: false,
-        reason:
-          "expected a gateway model route referencing an Anthropic model " +
-          "(e.g. claude-sonnet-4-5, anthropic/claude-*). " +
-          "Name routes to match the underlying model.",
-      };
+  return { ok: true };
 }

Or gate it behind an environment variable:

 function q5r(e) {
+  if (process.env.CLAUDE_CODE_SKIP_MODEL_VALIDATION) return { ok: true };
   return Jte(e) ? { ok: true } : { ok: false, reason: "..." };
 }

Additional Issue: Squirrel Launcher Crash

During investigation, we also found that the Squirrel launcher (%LOCALAPPDATA%\AnthropicClaude\claude.exe, 363KB, 32-bit PE) crashes with exit code -1073740791 (STATUS_INVALID_CRUNTIME_PARAMETER) when launched without arguments. This is independent of the asar issue — it crashes even with the original unmodified asar.

The app exe itself (app-1.6259.1\claude.exe, 64-bit PE) works fine when launched directly. The Squirrel launcher only works when called with explicit arguments: claude.exe --processStartAndWait claude.exe.

This means the Start Menu / desktop shortcuts (which point to the Squirrel launcher) don't work. Users must create a shortcut directly to app-1.6259.1\claude.exe.

Workaround (Verified Working)

Step 1: Replace app.asar (fixes model name validation)

Copy-Item "$env:LOCALAPPDATA\AnthropicClaude\app-1.5354.0\resources\app.asar" `
          "$env:LOCALAPPDATA\AnthropicClaude\app-1.6259.1\resources\app.asar" -Force

Step 2: Create direct shortcut (bypasses broken Squirrel launcher)

$shell = New-Object -ComObject WScript.Shell
$lnk = $shell.CreateShortcut("$env:USERPROFILE\Desktop\Claude.lnk")
$lnk.TargetPath = "$env:LOCALAPPDATA\AnthropicClaude\app-1.6259.1\claude.exe"
$lnk.WorkingDirectory = "$env:LOCALAPPDATA\AnthropicClaude\app-1.6259.1"
$lnk.IconLocation = "$env:LOCALAPPDATA\AnthropicClaude\app-1.6259.1\claude.exe,0"
$lnk.Save()

Restart Claude Desktop via the new shortcut. Both steps must be re-done after each update.

Why direct patching of app.asar doesn't work: The new app.asar has an Electron integrity check (asar_util.cc:143) that rejects modified archives. The expected hash is not stored in any discoverable file — it appears to be computed or embedded in a way that cannot be updated externally.

Impact

  • Affected: All third-party gateway users with custom model names (e.g. Xiaomi MiMo, corporate API gateways, any non-Anthropic inference provider).
  • Not affected: Users of Anthropic API, AWS Bedrock, Google Vertex AI, or gateways that happen to use model names containing Anthropic keywords.
  • CLI not affected: claude --model <any-name> works fine — this validation only exists in the Desktop app.

Environment

  • OS: Windows 11 Home China (10.0.26200)
  • Claude Desktop: 1.6259.1 (regression from 1.5354.0)
  • Gateway: Xiaomi MiMo API (token-plan-cn.xiaomimimo.com)
  • Model: mimo-v2.5-pro

Related Issues

  • #52572 — Support third-party inference providers in CLI (feature request)
  • #52526 — 3P Gateway model selector issues
  • #56758 — ConfigHealth stuck in provider_error

None report this specific model name validation regression.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING