| name | codex-auth-switch |
| description | Switch the OpenClaw main agent between explicit openai-codex OAuth auth profiles on command. Use when the user says things like “切换 alt2”, “切到 default”, “切换 openai-codex 账号”, “切换 Codex 登录”, or asks to switch the current main session auth profile between `openai-codex:default` and `openai-codex:alt2`. |
Codex Auth Switch
Switch the main agent's openai-codex auth priority by running the exact Windows command below.
Commands
cmd /c openclaw models auth order set --provider openai-codex --agent main openai-codex:alt2
cmd /c openclaw models auth order set --provider openai-codex --agent main openai-codex:default
Workflow
- Infer the target profile from the user's wording.
alt2, 切换alt2, 切到alt2, 用 alt2, 切换到第二个 codex => openai-codex:alt2
default, 切回default, 切到default, 用默认 codex, 切回主账号 => openai-codex:default
- Run the exact matching command with
exec.
- If the command succeeds, reply briefly with the profile now selected.
- If the command fails, show the real stderr/stdout and do not pretend it switched.
Boundaries
- Only switch for agent
main unless the user explicitly asks for another agent.
- Only target provider
openai-codex.
- Do not edit auth files directly for normal switching.
- If the user is ambiguous about target profile, ask whether they want
default or alt2.
Optional verification
When the user asks to verify, run:
cmd /c openclaw models status --agent main --probe --probe-provider openai-codex
You may also mention that newly created requests should follow the new priority, while already-running child sessions may still use their prior pinned profile.