openclaw - 💡(How to fix) Fix Bug: overwrites existing model catalog entries [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#68653Fetched 2026-04-19 15:09:04
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
commented ×1

openclaw config set replaces the entire agents.defaults.models object when adding models for additional providers, which makes previously configured models disappear. This is surprising in normal multi-provider setup flows and feels like a bug or at least a dangerous UX footgun.

Error Message

  • warn clearly that setting the object path replaces the full object, with docs/examples steering users to set nested keys instead.

Root Cause

openclaw config set replaces the entire agents.defaults.models object when adding models for additional providers, which makes previously configured models disappear. This is surprising in normal multi-provider setup flows and feels like a bug or at least a dangerous UX footgun.

Fix Action

Fix / Workaround

Expected behavior

Adding another model/provider should either:

  • merge into the existing agents.defaults.models object, or
  • warn clearly that setting the object path replaces the full object, with docs/examples steering users to set nested keys instead.

Code Example

openclaw config set agents.defaults.models '{"openai-codex/gpt-5.4":{}}' --strict-json
openclaw config set agents.defaults.models '{"anthropic/claude-sonnet-4-6":{}}' --strict-json

---

{
  "anthropic/claude-sonnet-4-6": {}
}

---

openclaw config set 'agents.defaults.models["openai-codex/gpt-5.4"]' '{}' --strict-json
openclaw config set 'agents.defaults.models["anthropic/claude-sonnet-4-6"]' '{}' --strict-json
RAW_BUFFERClick to expand / collapse

Summary

openclaw config set replaces the entire agents.defaults.models object when adding models for additional providers, which makes previously configured models disappear. This is surprising in normal multi-provider setup flows and feels like a bug or at least a dangerous UX footgun.

Version

OpenClaw 2026.4.15

Expected behavior

Adding another model/provider should either:

  • merge into the existing agents.defaults.models object, or
  • warn clearly that setting the object path replaces the full object, with docs/examples steering users to set nested keys instead.

Actual behavior

When using openclaw config set agents.defaults.models ... multiple times with different JSON objects, each call overwrites the entire agents.defaults.models map.

Reproduction

Start with a config where agents.defaults.models is empty or minimal.

Run:

openclaw config set agents.defaults.models '{"openai-codex/gpt-5.4":{}}' --strict-json
openclaw config set agents.defaults.models '{"anthropic/claude-sonnet-4-6":{}}' --strict-json

Result

After the second command, the config contains only:

{
  "anthropic/claude-sonnet-4-6": {}
}

The previously configured openai-codex/gpt-5.4 entry is gone.

Why this hurts

This is easy to hit while interactively configuring multiple providers/models. The CLI shape suggests incremental configuration, but object-path set behaves as full replacement. That makes multi-provider setup brittle and confusing.

Suggestions

  1. Merge object values by default for map-like config paths such as agents.defaults.models, or
  2. add a --merge mode, or
  3. emit a warning whenever setting an existing object path will replace sibling keys, and
  4. update docs with recommended commands like:
openclaw config set 'agents.defaults.models["openai-codex/gpt-5.4"]' '{}' --strict-json
openclaw config set 'agents.defaults.models["anthropic/claude-sonnet-4-6"]' '{}' --strict-json

Additional context

I hit this while configuring a multi-provider catalog across OpenAI Codex, Anthropic, OpenRouter, Google Gemini, and GitHub Copilot.

extent analysis

TL;DR

To avoid overwriting existing models, use the array or object key notation when setting agents.defaults.models with openclaw config set, such as openclaw config set 'agents.defaults.models["provider/model"]' '{}' --strict-json.

Guidance

  • When setting agents.defaults.models, use the specific key notation to add new models without overwriting existing ones, e.g., openclaw config set 'agents.defaults.models["openai-codex/gpt-5.4"]' '{}' --strict-json.
  • Verify the current configuration before making changes to avoid unintended overwrites.
  • Consider using the suggested commands in the documentation to ensure incremental configuration.
  • Be cautious when using openclaw config set with object paths, as it replaces the entire object by default.

Example

To add multiple models without overwriting existing ones, use the following commands:

openclaw config set 'agents.defaults.models["openai-codex/gpt-5.4"]' '{}' --strict-json
openclaw config set 'agents.defaults.models["anthropic/claude-sonnet-4-6"]' '{}' --strict-json

Notes

This workaround assumes that the openclaw config set command supports setting nested object keys. If this is not the case, alternative solutions may be necessary.

Recommendation

Apply the workaround by using the specific key notation when setting agents.defaults.models to avoid overwriting existing models, as it provides a safe and incremental way to configure multiple providers.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Adding another model/provider should either:

  • merge into the existing agents.defaults.models object, or
  • warn clearly that setting the object path replaces the full object, with docs/examples steering users to set nested keys instead.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING