Model Switcher
Change the global default LLM model in OpenClaw config, with a session-level availability check first.
Workflow
1) Read config and show available models first
Run:
CODEBLOCK0
Extract and show:
- - model key (for example
openai-codex/gpt-5.3-codex) - alias (for example
codex, opus) when present - current default model
Do not switch anything before showing options.
2) Ask user to choose model
Ask for the model name they want to set as the global default. Accept:
- - alias (preferred):
codex, INLINECODE4 - full provider/model id when configured
If the name is not in configured options, reject and ask again with the valid list.
3) Test selected model in current session first (availability/conflict check)
Before changing default config, apply a session-only override and run a live reply test.
In OpenClaw agent/tooling context:
- - Use
session_status with model=<selected-model>. - Confirm the override succeeds (no error about unknown/unavailable model).
- Then send a short test prompt to the model and require an actual response, for example:
- "What model/version are you currently running? Return provider/model id and a one-line status."
- - Treat this as pass only if the model returns a normal reply.
If override or live reply test fails:
- - Do not update default config.
- Report the error clearly.
- Explain that the model appears unavailable/misconfigured.
- Ask user to choose a different configured model.
If override and live reply test both succeed:
- - Continue to update default config.
4) Apply default-config change
Update default model in config:
CODEBLOCK1
Then verify:
CODEBLOCK2
Never claim success without verification output.
5) Ask before restarting gateway
After updating config, explicitly ask:
- - "Do you want me to restart the gateway now so the change takes effect?"
Only restart after a clear yes.
6) Restart gateway on confirmation
Run:
CODEBLOCK3
Then verify status:
CODEBLOCK4
If restart fails, report the error and suggest:
CODEBLOCK5
Response style
- - Be short and direct.
- Always show current default and valid model choices before asking for selection.
- Do not ask scope questions (no session-only final path in this skill).
- Always run a session-level availability check before writing default config.
- Always require explicit confirmation before restarting gateway.
- Never claim success without verification output.
模型切换器
更改 OpenClaw 配置中的全局默认 LLM 模型,并首先进行会话级别的可用性检查。
工作流程
1) 首先读取配置并显示可用模型
运行:
bash
openclaw config get agents.defaults.models
openclaw config get agents.defaults.model.primary
提取并显示:
- - 模型键(例如 openai-codex/gpt-5.3-codex)
- 别名(例如 codex、opus)(如果存在)
- 当前默认模型
在显示选项之前不要进行任何切换。
2) 询问用户选择模型
询问用户想要设置为全局默认的模型名称。接受:
- - 别名(首选):codex、opus
- 已配置的完整提供商/模型 ID
如果名称不在已配置的选项中,则拒绝并重新显示有效列表供用户选择。
3) 首先在当前会话中测试所选模型(可用性/冲突检查)
在更改默认配置之前,应用仅限会话的覆盖并运行实时回复测试。
在 OpenClaw 代理/工具上下文中:
- - 使用 model=<所选模型> 运行 session_status。
- 确认覆盖成功(没有关于未知/不可用模型的错误)。
- 然后向模型发送一个简短的测试提示并要求实际回复,例如:
- 你当前运行的是哪个模型/版本?返回提供商/模型 ID 和一行状态。
如果覆盖或实时回复测试失败:
- - 不要更新默认配置。
- 清晰地报告错误。
- 解释该模型似乎不可用或配置错误。
- 要求用户选择其他已配置的模型。
如果覆盖和实时回复测试均成功:
4) 应用默认配置更改
更新配置中的默认模型:
bash
openclaw config set agents.defaults.model.primary <所选模型>
然后验证:
bash
openclaw config get agents.defaults.model.primary
未经验证输出,切勿声称成功。
5) 在重启网关前询问
更新配置后,明确询问:
仅在得到明确肯定的回答后才重启。
6) 确认后重启网关
运行:
bash
openclaw gateway restart
然后验证状态:
bash
openclaw gateway status
如果重启失败,报告错误并建议:
bash
openclaw gateway stop
openclaw gateway start
openclaw gateway status
回复风格
- - 简洁直接。
- 在要求选择之前,始终显示当前默认和有效的模型选项。
- 不要询问范围问题(此技能中没有仅限会话的最终路径)。
- 在写入默认配置之前,始终运行会话级别的可用性检查。
- 在重启网关之前,始终要求明确确认。
- 未经验证输出,切勿声称成功。