Skip to content

fix(openclaw): register models added while editing a provider - #10191

Merged
funkpopo merged 1 commit into
farion1231:mainfrom
SaladDay:fix/openclaw-edit-syncs-model-catalog
Dec 2, 2026
Merged

funkpopo merged 1 commit into
farion1231:mainfrom
SaladDay:fix/openclaw-edit-syncs-model-catalog

Conversation

@SaladDay

@SaladDay SaladDay commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Human Note / 本人说明

Summary / 概述

Editing an OpenClaw provider never updated agents.defaults.models, so models added in the edit form could not be picked in /model. #9474 fixed the add path only.

After an edit is saved, models of the provider that are missing from the catalog get an empty entry. This follows the review on #6732:

  • Only providers present in the live config are synced; database-only providers are skipped.
  • An unset catalog stays unset.
  • Existing entries are kept verbatim (preset aliases, hand-added fields); nothing is removed.
  • OpenClaw queries are invalidated after the write, so an open agents-defaults panel does not save the old catalog back.

Related Issue / 关联 Issue

Fixes #6729

Screenshots / 截图

No UI change.

Testing

  • New useProviderActions test (edit adds a model, existing entry with alias and custom field kept) fails before the fix (setModelCatalog never called) and passes after.
  • Two more cases: no write when the provider is not in the live config, and none when the catalog is unset.
  • pnpm test:unit: 355 files, 4786 tests pass.
  • Not tested against a real OpenClaw install; the hook is covered with mocked APIs.

Checklist / 检查清单

  • pnpm typecheck passes / 通过 TypeScript 类型检查
  • pnpm format:check passes / 通过代码格式检查
  • cargo clippy passes (if Rust code changed) / 通过 Clippy 检查(如修改了 Rust 代码)
  • Updated i18n files if user-facing text changed / 如修改了用户可见文本,已更新国际化文件

Editing an OpenClaw provider never touched agents.defaults.models, so
models added in the edit form could not be picked in /model. After a
save, models of a provider in the live config that are missing from the
catalog now get an empty entry; existing entries stay as they are, and
an unset catalog is left unset.
@github-actions github-actions Bot added the frontend Frontend (React/TypeScript) label Dec 1, 2026

@allenxu09 allenxu09 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@allenxu09
allenxu09 requested a review from funkpopo December 2, 2026 01:20
@funkpopo
funkpopo merged commit 84dd063 into farion1231:main Dec 2, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Frontend (React/TypeScript)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[OpenClaw] 新增/编辑供应商后,agents.defaults.models 未同步"模型配置"中实际修改的模型

3 participants