openclaw - ✅(Solved) Fix [Bug]: openrouter/auto ignored by infer model run, falls back to openai/gpt-4.1-mini despite being configured as primary [1 pull requests]

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…

Error Message

startup model warmup failed for openrouter/@preset/asistente-diario: Error: Unknown model: openrouter/@preset/asistente-diario startup model warmup failed for openrouter/@preset/asistente-diario: Error: Unknown model: openrouter/@preset/asistente-diario startup model warmup failed for openrouter/@preset/asistente-diario: Error: Unknown model: openrouter/@preset/asistente-diario startup model warmup failed for openrouter/@preset/asistente-diario: Error: Unknown model: openrouter/@preset/asistente-diario

PR fix notes

PR #69580: fix: respect openrouter/auto model selection (#69527)

Description (problem / solution / changelog)

问题

#69527:openrouter/auto 被忽略,强制降级到 gpt-4.1-mini。

修复

在 的 中, 是特殊的哨兵模型,表示「让 OpenRouter 自动选择最佳模型」。OpenRouter API 期望的模型 ID 是裸的 ,而不是带前缀的 。

修复逻辑:

  • 当 时,将其规范化为
  • 使用 作为返回模型的 uid=0(root) gid=0(root) groups=0(root) 字段(这是发送到 OpenRouter API 的值)
  • 使用 查询模型能力缓存
  • 同步修复 和 钩子

同样的规范化逻辑也同步到了 中的 mock。

测试覆盖

  1. :新增测试验证 返回 ,以及正常模型 ID 保持不变
  2. :新增集成测试验证 返回正确模型

Changed files

  • extensions/openrouter/index.test.ts (modified, +52/-0)
  • extensions/openrouter/index.ts (modified, +12/-5)
  • src/agents/pi-embedded-runner/model.provider-runtime.test-support.ts (modified, +8/-4)
  • src/agents/pi-embedded-runner/model.test.ts (modified, +23/-0)
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

Version

OpenClaw 2026.4.15 (041266a)

Environment

  • Linux
  • Gateway managed by systemd
  • Service command: /usr/bin/node /home/alexifra/.local/lib/node_modules/openclaw/dist/index.js gateway --port 18789
  • Config file used by both CLI and service: ~/.openclaw/openclaw.json
  • Gateway restart succeeds and openclaw gateway status reports Runtime: running and RPC probe: ok

Goal

I want to use OpenRouter as the primary model for the gateway, with Gemini as first fallback and OpenAI as second fallback.

First related issue: OpenRouter preset is treated as unknown

I first configured this: json { "primary": "openrouter/@preset/asistente-diario", "fallbacks": [ "google/gemini-3.1-flash-lite-preview", "openai/gpt-4.1-mini" ] } openclaw models status showed the preset as the default model, but the gateway log said: text startup model warmup failed for openrouter/@preset/asistente-diario: Error: Unknown model: openrouter/@preset/asistente-diario So the preset ref is accepted in config/status, but rejected at runtime as an unknown model.

Main issue: openrouter/auto is shown as primary but runtime still uses OpenAI

After that, I switched to this config: json { "primary": "openrouter/auto", "fallbacks": [ "google/gemini-3.1-flash-lite-preview", "openai/gpt-4.1-mini" ] } I applied it with: bash openclaw config set agents.defaults.model --strict-json '{ "primary": "openrouter/auto", "fallbacks": [ "google/gemini-3.1-flash-lite-preview", "openai/gpt-4.1-mini" ] }' Then restarted the gateway: bash openclaw gateway restart openclaw gateway status The restart succeeded.

openclaw models status now shows: text Default : openrouter/openrouter/auto (from openrouter/auto) Fallbacks (2) : google/gemini-3.1-flash-lite-preview, openai/gpt-4.1-mini Configured models include openrouter/auto.

Reproduction

Run: bash openclaw infer model run --prompt "Reply with exactly: smoke-ok" --json

Actual result

It returns: json { "ok": true, "capability": "model.run", "transport": "local", "provider": "openai", "model": "gpt-4.1-mini", "attempts": [], "outputs": [ { "text": "smoke-ok", "mediaUrl": null } ] }

Expected result

I expect the run to use openrouter/auto as the primary model.

If OpenRouter fails and fallback is used, I would expect that to be visible in the run details, at minimum in attempts.

Observed behavior summary

There seem to be two related OpenRouter model-resolution/runtime problems on this install:

  1. openrouter/@preset/asistente-diario is shown in config/status but runtime says Unknown model.
  2. openrouter/auto is shown as the default model in models status, but infer model run still executes on openai/gpt-4.1-mini with attempts: [].

This makes it look like the configured OpenRouter primary is not actually being used by the runtime, even though the config and status output say it is.

Steps to reproduce

Version

OpenClaw 2026.4.15 (041266a)

Environment

  • Linux
  • Gateway managed by systemd
  • Service command: /usr/bin/node /home/alexifra/.local/lib/node_modules/openclaw/dist/index.js gateway --port 18789
  • Config file used by both CLI and service: ~/.openclaw/openclaw.json
  • Gateway restart succeeds and openclaw gateway status reports Runtime: running and RPC probe: ok

Goal

I want to use OpenRouter as the primary model for the gateway, with Gemini as first fallback and OpenAI as second fallback.

First related issue: OpenRouter preset is treated as unknown

I first configured this: json { "primary": "openrouter/@preset/asistente-diario", "fallbacks": [ "google/gemini-3.1-flash-lite-preview", "openai/gpt-4.1-mini" ] } openclaw models status showed the preset as the default model, but the gateway log said: text startup model warmup failed for openrouter/@preset/asistente-diario: Error: Unknown model: openrouter/@preset/asistente-diario So the preset ref is accepted in config/status, but rejected at runtime as an unknown model.

Main issue: openrouter/auto is shown as primary but runtime still uses OpenAI

After that, I switched to this config: json { "primary": "openrouter/auto", "fallbacks": [ "google/gemini-3.1-flash-lite-preview", "openai/gpt-4.1-mini" ] } I applied it with: bash openclaw config set agents.defaults.model --strict-json '{ "primary": "openrouter/auto", "fallbacks": [ "google/gemini-3.1-flash-lite-preview", "openai/gpt-4.1-mini" ] }' Then restarted the gateway: bash openclaw gateway restart openclaw gateway status The restart succeeded.

openclaw models status now shows: text Default : openrouter/openrouter/auto (from openrouter/auto) Fallbacks (2) : google/gemini-3.1-flash-lite-preview, openai/gpt-4.1-mini Configured models include openrouter/auto.

Reproduction

Run: bash openclaw infer model run --prompt "Reply with exactly: smoke-ok" --json

Actual result

It returns: json { "ok": true, "capability": "model.run", "transport": "local", "provider": "openai", "model": "gpt-4.1-mini", "attempts": [], "outputs": [ { "text": "smoke-ok", "mediaUrl": null } ] }

Expected result

I expect the run to use openrouter/auto as the primary model.

If OpenRouter fails and fallback is used, I would expect that to be visible in the run details, at minimum in attempts.

Observed behavior summary

There seem to be two related OpenRouter model-resolution/runtime problems on this install:

  1. openrouter/@preset/asistente-diario is shown in config/status but runtime says Unknown model.
  2. openrouter/auto is shown as the default model in models status, but infer model run still executes on openai/gpt-4.1-mini with attempts: [].

This makes it look like the configured OpenRouter primary is not actually being used by the runtime, even though the config and status output say it is.

Expected behavior

Version

OpenClaw 2026.4.15 (041266a)

Environment

  • Linux
  • Gateway managed by systemd
  • Service command: /usr/bin/node /home/alexifra/.local/lib/node_modules/openclaw/dist/index.js gateway --port 18789
  • Config file used by both CLI and service: ~/.openclaw/openclaw.json
  • Gateway restart succeeds and openclaw gateway status reports Runtime: running and RPC probe: ok

Goal

I want to use OpenRouter as the primary model for the gateway, with Gemini as first fallback and OpenAI as second fallback.

First related issue: OpenRouter preset is treated as unknown

I first configured this: json { "primary": "openrouter/@preset/asistente-diario", "fallbacks": [ "google/gemini-3.1-flash-lite-preview", "openai/gpt-4.1-mini" ] } openclaw models status showed the preset as the default model, but the gateway log said: text startup model warmup failed for openrouter/@preset/asistente-diario: Error: Unknown model: openrouter/@preset/asistente-diario So the preset ref is accepted in config/status, but rejected at runtime as an unknown model.

Main issue: openrouter/auto is shown as primary but runtime still uses OpenAI

After that, I switched to this config: json { "primary": "openrouter/auto", "fallbacks": [ "google/gemini-3.1-flash-lite-preview", "openai/gpt-4.1-mini" ] } I applied it with: bash openclaw config set agents.defaults.model --strict-json '{ "primary": "openrouter/auto", "fallbacks": [ "google/gemini-3.1-flash-lite-preview", "openai/gpt-4.1-mini" ] }' Then restarted the gateway: bash openclaw gateway restart openclaw gateway status The restart succeeded.

openclaw models status now shows: text Default : openrouter/openrouter/auto (from openrouter/auto) Fallbacks (2) : google/gemini-3.1-flash-lite-preview, openai/gpt-4.1-mini Configured models include openrouter/auto.

Reproduction

Run: bash openclaw infer model run --prompt "Reply with exactly: smoke-ok" --json

Actual result

It returns: json { "ok": true, "capability": "model.run", "transport": "local", "provider": "openai", "model": "gpt-4.1-mini", "attempts": [], "outputs": [ { "text": "smoke-ok", "mediaUrl": null } ] }

Expected result

I expect the run to use openrouter/auto as the primary model.

If OpenRouter fails and fallback is used, I would expect that to be visible in the run details, at minimum in attempts.

Observed behavior summary

There seem to be two related OpenRouter model-resolution/runtime problems on this install:

  1. openrouter/@preset/asistente-diario is shown in config/status but runtime says Unknown model.
  2. openrouter/auto is shown as the default model in models status, but infer model run still executes on openai/gpt-4.1-mini with attempts: [].

This makes it look like the configured OpenRouter primary is not actually being used by the runtime, even though the config and status output say it is.

Actual behavior

Version

OpenClaw 2026.4.15 (041266a)

Environment

  • Linux
  • Gateway managed by systemd
  • Service command: /usr/bin/node /home/alexifra/.local/lib/node_modules/openclaw/dist/index.js gateway --port 18789
  • Config file used by both CLI and service: ~/.openclaw/openclaw.json
  • Gateway restart succeeds and openclaw gateway status reports Runtime: running and RPC probe: ok

Goal

I want to use OpenRouter as the primary model for the gateway, with Gemini as first fallback and OpenAI as second fallback.

First related issue: OpenRouter preset is treated as unknown

I first configured this: json { "primary": "openrouter/@preset/asistente-diario", "fallbacks": [ "google/gemini-3.1-flash-lite-preview", "openai/gpt-4.1-mini" ] } openclaw models status showed the preset as the default model, but the gateway log said: text startup model warmup failed for openrouter/@preset/asistente-diario: Error: Unknown model: openrouter/@preset/asistente-diario So the preset ref is accepted in config/status, but rejected at runtime as an unknown model.

Main issue: openrouter/auto is shown as primary but runtime still uses OpenAI

After that, I switched to this config: json { "primary": "openrouter/auto", "fallbacks": [ "google/gemini-3.1-flash-lite-preview", "openai/gpt-4.1-mini" ] } I applied it with: bash openclaw config set agents.defaults.model --strict-json '{ "primary": "openrouter/auto", "fallbacks": [ "google/gemini-3.1-flash-lite-preview", "openai/gpt-4.1-mini" ] }' Then restarted the gateway: bash openclaw gateway restart openclaw gateway status The restart succeeded.

openclaw models status now shows: text Default : openrouter/openrouter/auto (from openrouter/auto) Fallbacks (2) : google/gemini-3.1-flash-lite-preview, openai/gpt-4.1-mini Configured models include openrouter/auto.

Reproduction

Run: bash openclaw infer model run --prompt "Reply with exactly: smoke-ok" --json

Actual result

It returns: json { "ok": true, "capability": "model.run", "transport": "local", "provider": "openai", "model": "gpt-4.1-mini", "attempts": [], "outputs": [ { "text": "smoke-ok", "mediaUrl": null } ] }

Expected result

I expect the run to use openrouter/auto as the primary model.

If OpenRouter fails and fallback is used, I would expect that to be visible in the run details, at minimum in attempts.

Observed behavior summary

There seem to be two related OpenRouter model-resolution/runtime problems on this install:

  1. openrouter/@preset/asistente-diario is shown in config/status but runtime says Unknown model.
  2. openrouter/auto is shown as the default model in models status, but infer model run still executes on openai/gpt-4.1-mini with attempts: [].

This makes it look like the configured OpenRouter primary is not actually being used by the runtime, even though the config and status output say it is.

OpenClaw version

OpenClaw 2026.4.15 (041266a)

Operating system

Winddows 11 WSL

Install method

No response

Model

openrouter

Provider / routing chain

openclaw

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The issue can be resolved by verifying the OpenRouter model configuration and ensuring that the openrouter/auto model is properly set as the primary model in the OpenClaw configuration.

Guidance

  • Verify that the openrouter/auto model is correctly configured in the ~/.openclaw/openclaw.json file.
  • Check the OpenClaw logs for any errors related to model loading or configuration.
  • Run openclaw models status to confirm that the openrouter/auto model is listed as the default model.
  • Test the configuration by running openclaw infer model run --prompt "Reply with exactly: smoke-ok" --json and verifying that the response comes from the openrouter/auto model.

Example

No code example is provided as the issue seems to be related to configuration rather than code.

Notes

The issue may be related to a misconfiguration or a bug in the OpenClaw software. Further investigation and debugging may be necessary to resolve the issue.

Recommendation

Apply workaround: Verify the OpenRouter model configuration and ensure that the openrouter/auto model is properly set as the primary model in the OpenClaw configuration. This may involve checking the ~/.openclaw/openclaw.json file and running openclaw models status to confirm the configuration.

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

openclaw - ✅(Solved) Fix [Bug]: openrouter/auto ignored by infer model run, falls back to openai/gpt-4.1-mini despite being configured as primary [1 pull requests]