Bug Description
When updating model providers in the global openclaw.json configuration, the changes are not automatically synced to individual agent models.json files. This causes agents to not see newly added models/providers.
Problem Context
OpenClaw has two levels of model configuration:
- Global config:
~/.openclaw/openclaw.json → models.providers
- Per-agent config:
~/.openclaw/agents/{agentId}/agent/models.json → providers
The global config is the source of truth, but agent configs are not automatically updated when the global config changes.
Real-world Impact
My case:
- Fixed gateway config issue (invalid
apiKeys section + missing alibaba provider config)
- Updated
openclaw.json with correct alibaba provider configuration
- Gateway restarted successfully
- But main agent still couldn't see the qwen3.5-plus model
- Other agents (worker-exec, worker-review) also missing the alibaba provider in their
models.json
Root cause:
global openclaw.json: { minimax, zai, kimi-coding, alibaba } ✅
agents/main/agent/models.json: { minimax, zai, kimi-coding, alibaba } ✅ (manually fixed)
agents/worker-exec/agent/models.json: { minimax, zai } ❌ (missing alibaba, kimi-coding)
agents/worker-review/agent/models.json: { minimax, zai } ❌ (missing alibaba, kimi-coding)
Expected Behavior
When running openclaw gateway restart (or any config change command), the system should:
- Validate global config ✅
- Auto-sync model providers to all agent
models.json files ❌ (missing)
- Restart gateway with updated config
Current Workaround
Manual sync required:
# Write a custom script to copy providers from global to each agent
python3 << 'EOF'
import json, os
with open('~/.openclaw/openclaw.json') as f:
global_config = json.load(f)
global_providers = global_config['models']['providers']
for agent_id in os.listdir('~/.openclaw/agents'):
models_json = f'~/.openclaw/agents/{agent_id}/agent/models.json'
if os.path.exists(models_json):
with open(models_json) as f:
agent_config = json.load(f)
agent_config['providers'] = global_providers.copy()
with open(models_json, 'w') as f:
json.dump(agent_config, f, indent=2)
EOF
Proposed Solutions
Option 1: Auto-sync on gateway restart (Recommended)
Add automatic sync in openclaw gateway restart command to update all agent models.json files from global config.
Option 2: New CLI command
openclaw agents sync-models
Option 3: Remove per-agent models.json
Have agents read directly from global config at runtime (may break agent isolation design).
Environment
- OpenClaw version:
2026.2.19-2
- OS: macOS
- Gateway mode: local
Additional Context
This is a design gap - the agent isolation model expects each agent to have its own config, but model providers should be managed centrally and propagated to agents automatically.
Bug Description
When updating model providers in the global
openclaw.jsonconfiguration, the changes are not automatically synced to individual agentmodels.jsonfiles. This causes agents to not see newly added models/providers.Problem Context
OpenClaw has two levels of model configuration:
~/.openclaw/openclaw.json→models.providers~/.openclaw/agents/{agentId}/agent/models.json→providersThe global config is the source of truth, but agent configs are not automatically updated when the global config changes.
Real-world Impact
My case:
apiKeyssection + missing alibaba provider config)openclaw.jsonwith correct alibaba provider configurationmodels.jsonRoot cause:
Expected Behavior
When running
openclaw gateway restart(or any config change command), the system should:models.jsonfiles ❌ (missing)Current Workaround
Manual sync required:
Proposed Solutions
Option 1: Auto-sync on gateway restart (Recommended)
Add automatic sync in
openclaw gateway restartcommand to update all agentmodels.jsonfiles from global config.Option 2: New CLI command
Option 3: Remove per-agent models.json
Have agents read directly from global config at runtime (may break agent isolation design).
Environment
2026.2.19-2Additional Context
This is a design gap - the agent isolation model expects each agent to have its own config, but model providers should be managed centrally and propagated to agents automatically.