fix(config): preserve agent-level apiKey/baseUrl during models.json merge#27293
Merged
gumadeiras merged 5 commits intoopenclaw:mainfrom Feb 26, 2026
Merged
Conversation
Contributor
Greptile SummaryCorrectly preserves agent-level
The implementation properly guards against edge cases (empty strings, non-string values, undefined) and maintains backward compatibility. Confidence Score: 5/5
Last reviewed commit: c61a624 |
c61a624 to
130b90f
Compare
…erge
When ensureOpenClawModelsJson runs in merge mode, the shallow merge
{ ...existingProviders, ...providers } causes the main config to
overwrite agent-level models.json entries entirely. This drops any
apiKey or baseUrl that the user set specifically for an agent.
Preserve existing agent-level apiKey and baseUrl when merging, while
still accepting all other updates (model catalog, api type, etc.)
from the newly computed provider config.
Closes openclaw#27243
448e48e to
6b4b37b
Compare
Member
NOVA-Openclaw
added a commit
to NOVA-Openclaw/nova-openclaw
that referenced
this pull request
Feb 26, 2026
Syncs 29 upstream commits including: - Account-scoped bind and routing commands (openclaw#27195) - Single-account config migration to accounts.default (openclaw#27334) - Preserve agent-level apiKey/baseUrl during models.json merge (openclaw#27293) - Plugin-owned interactive channel onboarding flows (openclaw#27191) - Android notifications.list, invoke refactoring - Daemon launchd restart hardening - SSRF dispatcher fix, doctor improvements Conflict resolution: 4 import-order conflicts in onboarding/channel commands resolved by taking upstream (no custom code in those files).
steipete
pushed a commit
that referenced
this pull request
Feb 26, 2026
…erge (#27293) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 6b4b37b Co-authored-by: Sid-Qin <201593046+Sid-Qin@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
This was referenced Feb 26, 2026
execute008
pushed a commit
to execute008/openclaw
that referenced
this pull request
Feb 27, 2026
…erge (openclaw#27293) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 6b4b37b Co-authored-by: Sid-Qin <201593046+Sid-Qin@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
r4jiv007
pushed a commit
to r4jiv007/openclaw
that referenced
this pull request
Feb 28, 2026
…erge (openclaw#27293) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 6b4b37b Co-authored-by: Sid-Qin <201593046+Sid-Qin@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
vincentkoc
pushed a commit
to Sid-Qin/openclaw
that referenced
this pull request
Feb 28, 2026
…erge (openclaw#27293) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 6b4b37b Co-authored-by: Sid-Qin <201593046+Sid-Qin@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
vincentkoc
pushed a commit
to rylena/rylen-openclaw
that referenced
this pull request
Feb 28, 2026
…erge (openclaw#27293) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 6b4b37b Co-authored-by: Sid-Qin <201593046+Sid-Qin@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
steipete
pushed a commit
to Sid-Qin/openclaw
that referenced
this pull request
Mar 2, 2026
…erge (openclaw#27293) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 6b4b37b Co-authored-by: Sid-Qin <201593046+Sid-Qin@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
steipete
pushed a commit
to Sid-Qin/openclaw
that referenced
this pull request
Mar 2, 2026
…erge (openclaw#27293) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 6b4b37b Co-authored-by: Sid-Qin <201593046+Sid-Qin@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
dorgonman
pushed a commit
to kanohorizonia/openclaw
that referenced
this pull request
Mar 3, 2026
…erge (openclaw#27293) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 6b4b37b Co-authored-by: Sid-Qin <201593046+Sid-Qin@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
…erge (openclaw#27293) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 6b4b37b Co-authored-by: Sid-Qin <201593046+Sid-Qin@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
thebenjaminlee
pushed a commit
to escape-velocity-ventures/openclaw
that referenced
this pull request
Mar 7, 2026
…erge (openclaw#27293) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 6b4b37b Co-authored-by: Sid-Qin <201593046+Sid-Qin@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
models.jsonentries (with customapiKey/baseUrl) are silently overwritten by the mainopenclaw.jsonconfig duringensureOpenClawModelsJson()merge, because the shallow merge{ ...existingProviders, ...providers }replaces entire provider objects.apiKeyandbaseUrlwhen merging new provider data, while still accepting model catalog updates (models, api type, etc.) from the main config.models.jsonare unaffected.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Agent-level
apiKeyandbaseUrlin~/.openclaw/agents/{agentId}/agent/models.jsonare now preserved across config refreshes. Previously they were silently replaced by the main config values.Security Impact (required)
Testing
npx vitest run src/agents/models-config— 43 tests ✓Rollback Plan
Revert the single commit. No migration or data changes involved.