← Back to library

/model 被误判 not allowed:从排查到临时切换方案

问题/场景:TUI `/model` 下拉或手输模型都被拒绝,即便 allowlist 已正确配置。前置条件:OpenClaw 2026.2.17 附近版本,已配置 `agents.defaults.models`。实施步骤:先用 `openclaw models status` 对齐配置→复现实例并收集错误模型 ID→短期通过 config patch 切主模型。关键命令:`sessions.patch` 报错与模型状态核对。验证:主模型切换后新会话生效。风险:临时 patch 会影响全局默认模型,需沟通变更窗口。

GITHUBDiscovered 2026-02-19Author kensipe
Prerequisites
  • Model allowlist is explicitly configured and gateway can read config file.
  • You can restart gateway and test in TUI/CLI without impacting critical production traffic.
Steps
  1. Run `openclaw models status` and confirm target model/alias appears in allowlist output.
  2. Reproduce `/model` failure in TUI and capture exact rejected model ID from gateway logs.
  3. Compare dropdown-selected ID vs configured allowlist ID to detect stale mapping.
  4. Apply temporary workaround: patch `agents.defaults.model.primary` to desired model and restart gateway.
  5. Track upstream fix progress and remove workaround once session-level override path is corrected.
Commands
openclaw models status
openclaw gateway status
openclaw gateway restart
Verify

After workaround, new sessions run on target model and gateway no longer returns immediate `model not allowed` for default path.

Caveats
  • Issue indicates runtime path mismatch; exact root cause may change after patch releases(需验证).
  • Avoid frequent model flips during active runs to prevent user-facing inconsistency.
Source attribution

This tip is aggregated from community/public sources and preserved with attribution.

Open original source ↗
Visit original post