Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: 阻止批量删除模型后被自动拉回#312

Open
panzeyu2013 wants to merge 1 commit into
qxcnm:main from
panzeyu2013:fix-autorefresh
Open

fix: 阻止批量删除模型后被自动拉回 #312
panzeyu2013 wants to merge 1 commit into
qxcnm:main from
panzeyu2013:fix-autorefresh

Conversation

@panzeyu2013

@panzeyu2013 panzeyu2013 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

问题

从聚合 API 导入模型后,手动批量删除这些模型,在没有点击"上游同步"的情况下,系统自动将已删除的模型重新拉取回来。

根因

三处代码在模型目录缓存为空时会自动触发远端拉取或重建:

  1. read_managed_model_catalog(false) — 缓存为空时穿透到 gateway::fetch_models_for_picker()
  2. auto_associate_source_models — 路由读取时 auto_create_platform_models=true 自动重建已删除的条目
  3. read_account_pool_platform_catalog — 同样在缓存为空时穿透到远端拉取(仅影响有 OpenAI 账号的用户)

修复

# 位置 修复内容
1 read_managed_model_catalog L77 refresh_remote=false 时始终返回缓存,不再因缓存为空而远端拉取
2 delete_model_catalog_entry L1796 删除模型时设置 unlinked 偏好,阻止 auto_associate_source_models 自动重建
3 read_account_pool_platform_catalog L857 仅首次初始化(scope_record 为空)时远端拉取,已初始化过的空目录不再穿透

验证

修改集中在 crates/service/src/apikey/apikey_models.rs,建议运行:

cargo test -p codexmanager-service

删除模型后 reloadManagedCatalog(false) 在缓存为空时会穿透到远端拉取,
导致刚删除的模型被重新并入目录。同时 auto_associate_source_models
在路由读取时会自动重建已删除的模型条目。
三处修复:
1. read_managed_model_catalog: refresh_remote=false 时始终返回缓存
2. delete_model_catalog_entry: 删除时设置 unlinked 偏好阻止自动关联重建
3. read_account_pool_platform_catalog: 仅首次初始化时远端拉取,已初始化过的空目录不再穿透
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /