Conversation
…model Deleting a provider that settings.active_model points at left a dead ref: every subsequent turn failed to resolve the default model with no hint (agents report 'model call failed after retries'). Guard it the same way as agent refs - reject with PROVIDER_REFERENCED and tell the admin to switch the default model first.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
删除 provider 时只检查了 agent 引用(
find_agents_using_provider),漏了 settings 表的全局默认模型active_model。当active_model指向被删的 provider 时(没有 agent 显式 pin 它),删除后所有对话回合的默认模型解析失败——用户无提示地看到"模型调用多次重试后仍失败"。修复
admin_delete_provider里补一道检查:settings_repo.get_active_model()引用了该 provider 则拒绝删除(PROVIDER_REFERENCED,details 带 active_model 引用),提示先切换默认模型。验证
提供商正在使用中,无法删除+ details 带active_model: 主对话模型/deepseek-v4-flash