← Back to library

`/model default|reset|clear` 失效时的修复与验收:恢复会话默认模型回退

问题/场景:用户切换过模型后,执行 `/model default` 却报 `Model 'anthropic/default' is not allowed`,无法回到默认模型。前置条件:会话存在 model override 且可执行命令指令。实施步骤:升级到包含 PR #20195 的版本→在同一会话依次测试 `/model <other>` 与 `/model default|reset|clear`→检查 session entry 中 `modelOverride` 被清空。关键命令:`/model default`。验证:会话重新使用配置默认模型。风险:若 allowlist/默认模型本身配置错误,仍会失败(需验证)。

GITHUBDiscovered 2026-02-19Author zhangjunmengyang
Prerequisites
  • At least one session has previously switched model via `/model`, so model override behavior is observable.
  • You can upgrade gateway build and inspect session status after command execution.
Steps
  1. Upgrade to a build containing PR #20195 and restart gateway cleanly.
  2. In one session, switch to a non-default model using `/model <provider/model>`.
  3. Run `/model default`, `/model reset`, and `/model clear` one by one to verify all reset aliases.
  4. Check session status/metadata to confirm `modelOverride` is cleared and default mapping is active.
Commands
openclaw gateway status
openclaw gateway restart
openclaw status
Verify

After reset directive, the same session uses configured default model and no `anthropic/default` allowlist error appears.

Caveats
  • PR is open at discovery time; verify merged behavior in your installed release before broad rollout(需验证).
  • If per-session model pinning is required by policy, do not auto-reset all sessions.
Source attribution

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

Open original source ↗
Visit original post