
Model Switch
Switch the Manager Agent's own LLM model.
Install
npx skills add agentscope-ai/AgentTeams --skill model-switch -g -a claude-code -y- Repository
- agentscope-ai/AgentTeams5.9k
- Category
- AI and agents
- Updated
- 3d ago
- License
- Apache-2.0
- Context cost
- Lightabout 1,065 tokens
- Runs scripts
- Yes, review before use
What it does
Switch the Manager Agent's own LLM model. Use when the human admin requests changing the Manager's model.
Model Switch
Switch the Manager's own LLM model. The script tests connectivity first, then patches openclaw.json.
Usage
bash /opt/agentteams/agent/skills/model-switch/scripts/update-manager-model.sh <MODEL_ID> [--context-window <SIZE>] [--no-reasoning]
Examples:
bash /opt/agentteams/agent/skills/model-switch/scripts/update-manager-model.sh claude-sonnet-4-6
bash /opt/agentteams/agent/skills/model-switch/scripts/update-manager-model.sh my-custom-model --context-window 300000
bash /opt/agentteams/agent/skills/model-switch/scripts/update-manager-model.sh deepseek-chat --no-reasoning
What the script does
- Strips any
agentteams-gateway/prefix from the model name - Tests the model via
POST /v1/chat/completionson the AI Gateway, exits with error if unreachable - If the model is already in the
modelsarray: refreshes itsreasoning/contextWindow/maxTokens/inputfields and switchesagents.defaults.model.primary - If the model is new: adds it to the
modelsarray and switches primary - Always outputs
RESTART_REQUIRED
Because step 3 rewrites the model's fields, re-running the script is the way to
correct an entry that was first written with wrong values, for example a model
that was added with the 150,000 default because nobody knew its real window:
run the script again with --context-window <SIZE> and the new value lands in
openclaw.json.
After running the script
The script always outputs RESTART_REQUIRED. Run openclaw gateway restart to apply the change, then tell the human admin the switch is complete.
Reasoning control
By default, reasoning (extended thinking) is enabled. To disable it, pass --no-reasoning.
On failure
If the gateway test fails (non-200), the script outputs ERROR: MODEL_NOT_REACHABLE and exits. No changes are made to openclaw.json.
When you see this error, tell the human admin clearly:

