fix: address review — no auto-hijack, sync model on activation, cleanup

1. Creating a provider no longer auto-switches bot_type. Only an
   explicit make_active=true changes the active model — prevents
   silently hijacking users on Claude/OpenAI/etc.

2. When a provider IS activated, its 'model' is now written into the
   global 'model' field. This ensures all three paths (regular chat,
   agent_bridge, vision) use the correct model without per-path patches.

3. Removed unused i18n key 'models_custom_name_exists' (no longer
   referenced after the id-based rework removed name-collision checks).

4. Updated tests: 39 passing (added model-sync tests, fixed tests that
   relied on the removed auto-activation behavior).
This commit is contained in:
kirs-hi
2026-06-12 10:05:05 +08:00
parent 1940d628a8
commit 0092376c07
3 changed files with 56 additions and 16 deletions

View File

@@ -46,7 +46,6 @@ const I18N = {
models_custom_delete_confirm_msg: '确定删除该自定义厂商吗?此操作无法撤销。',
models_custom_name_required: '请填写名称',
models_custom_base_required: '请填写 API Base',
models_custom_name_exists: '该名称已存在',
models_custom_empty: '尚未配置自定义厂商,点击添加',
models_custom_edit_title: '编辑自定义厂商',
models_custom_add_title: '添加自定义厂商',
@@ -268,7 +267,6 @@ const I18N = {
models_custom_delete_confirm_msg: 'Delete this custom provider? This cannot be undone.',
models_custom_name_required: 'Name is required',
models_custom_base_required: 'API Base is required',
models_custom_name_exists: 'A provider with this name already exists',
models_custom_empty: 'No custom providers yet, click to add',
models_custom_edit_title: 'Edit custom provider',
models_custom_add_title: 'Add custom provider',