Skip to content

feat(setting): set default model setting 自动重置默认模型#1813

Merged
coltea merged 1 commit into
chaitin:mainfrom
coltea:feat-auto-config
Jun 29, 2026
Merged

feat(setting): set default model setting 自动重置默认模型#1813
coltea merged 1 commit into
chaitin:mainfrom
coltea:feat-auto-config

Conversation

@coltea

@coltea coltea commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

PR 标题

自动重置默认模型

变更类型

请勾选适用的变更类型:

  • Bug 修复 (不兼容变更的修复)
  • 新功能 (不兼容变更的新功能)
  • 功能改进 (不兼容现有功能的改进)
  • 文档更新
  • 依赖更新
  • 重构 (不影响功能的代码修改)
  • 测试用例
  • CI/CD 配置变更
  • 其他 (请描述):

变更内容

详细描述本次 PR 的具体变更内容:

  1. 自动重置默认模型

测试情况

描述本次变更的测试情况:

  • 已本地测试
  • 已添加测试用例
  • 不需要测试 (理由: )

其他说明

任何其他需要说明的事项:

Copilot AI review requested due to automatic review settings June 29, 2026 03:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

该 PR 针对管理端「自动配置」模式下的对话模型选择逻辑做了“默认值归一化”,确保当后端/历史配置传入的 initialChatModel 不在预置模型列表中时,前端会自动回退到默认模型,从而避免出现无效模型导致的选择框异常或配置不可用。

Changes:

  • 将「百智云 Chat 模型列表」提升为组件外常量,避免每次渲染重复创建。
  • 新增 getDefaultChatModel:当传入模型不在白名单时,自动回退到列表首个默认模型。
  • 初始化与 initialChatModel 更新时,统一通过 getDefaultChatModel 进行默认模型重置。

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread web/admin/src/components/System/component/AutoModelConfig.tsx
@coltea
coltea merged commit b571a26 into chaitin:main Jun 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants