refactor: improve sanity_check_models to include editor model check

This commit is contained in:
Paul Gauthier (aider) 2024-10-02 11:13:44 -07:00
parent 992600fcb7
commit 03faad3110

View file

@ -915,11 +915,19 @@ def validate_variables(vars):
def sanity_check_models(io, main_model):
problem_main = sanity_check_model(io, main_model)
problem_weak = None
problem_strong = sanity_check_model(io, main_model)
if main_model.weak_model and main_model.weak_model is not main_model:
problem_weak = sanity_check_model(io, main_model.weak_model)
return problem_strong or problem_weak
problem_editor = None
if (main_model.editor_model and
main_model.editor_model is not main_model and
main_model.editor_model is not main_model.weak_model):
problem_editor = sanity_check_model(io, main_model.editor_model)
return problem_main or problem_weak or problem_editor
def sanity_check_model(io, model):