← Back to library

模型切换不生效排障:避免 agent 启动后继续使用旧 models 快照

问题/场景:你修改了 gateway 模型配置,但存量 agent 仍按旧快照选模。前置条件:已配置多模型或模型别名。实施步骤:先确认症状→重启受影响 session/agent→统一模型别名配置→再做回归测试。关键命令:`/status`、`openclaw gateway restart`。验证:新会话和重启后的会话都按目标模型响应。风险:批量重启可能中断正在执行的任务。

GITHUBDiscovered 2026-02-15Author fand
Prerequisites
  • You have changed gateway model config or aliases after some sessions were already created.
  • You can compare model identity from session status before/after remediation.
Steps
  1. Capture baseline from affected session(s): record current model alias/provider shown in status.
  2. Apply the intended model config centrally (aliases preferred) and avoid per-session drift.
  3. Restart impacted agent sessions (or recreate them) so runtime reloads the updated model mapping.
  4. Run the same test prompt in old/new sessions and compare effective model + output behavior.
Commands
openclaw gateway status
openclaw gateway restart
openclaw status
Verify

After session restart, status reflects the intended model alias/provider and responses match expected capability/cost profile.

Caveats
  • Behavior may differ across versions while upstream fix is evolving; treat this as an operational workaround(需验证).
  • Coordinate restarts for long-running jobs to avoid interrupting critical workflows.
Source attribution

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

Open original source ↗
Visit original post