Skip to content

保留禁用聚合 API 的模型池#309

Open
DemosHume wants to merge 1 commit into
qxcnm:mainfrom
DemosHume:fix-aggregate-api-model-pool-toggle
Open

保留禁用聚合 API 的模型池#309
DemosHume wants to merge 1 commit into
qxcnm:mainfrom
DemosHume:fix-aggregate-api-model-pool-toggle

Conversation

@DemosHume

Copy link
Copy Markdown
Contributor

改动文件

  • crates/service/src/apikey/apikey_models.rs

解决问题

聚合 API 禁用后,如果页面或接口触发模型路由 bootstrap,原逻辑会把非 active 的聚合 API 当作 stale source 清理,导致该聚合 API 的模型池、模型映射和映射偏好被删除。再次启用后模型池看起来被重置。

本次调整为:

  • 禁用的聚合 API 仍保留模型池与模型路由配置。
  • 已删除或不存在的聚合 API 仍按孤儿 source 清理。
  • active 聚合 API 仍继续执行自动模型关联。

影响范围

  • 影响服务端模型路由 bootstrap 与聚合 API 模型同步边界。
  • 不修改数据库结构、前端页面或聚合 API 开关接口参数。
  • 删除聚合 API 后的孤儿模型清理行为保持存在。

验证

  • cargo test -p codexmanager-service aggregate_bootstrap -- --nocapture
  • cargo test -p codexmanager-service bootstrap_aggregate -- --nocapture

风险

风险较低。主要行为变化是 disabled 聚合 API 不再被当成 stale source 清理;真正不存在的 source 仍会被清理。这样禁用/启用不会丢失用户维护的模型池和映射偏好。

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.

1 participant