You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(llm): the failsafe agent has three disagreeing defaults and no real fallback — primary and secondary resolve to the same model #19733
The failsafe agent has no single default, and as configured it has nothing to fall back to.
Three disagreeing defaults:
backend.env.j2:172 and agents.yaml:31 set the failsafe model to dolphin-llama3:8b.
The AI-stack defaults (defaults:79) set phi3:mini.
The SSOT has no default: get_agent_model_explicit (ssot_config.py:3030) raises if the value is unset.
No real fallback:llm_failsafe_agent.py:110-111 resolves primary and secondary to the same model. When that model is missing, both tiers fail together. On the audited host the model was never pulled (#19731).
Fix
One SSOT default for the failsafe role. It must be the smallest model that is always pulled on every install type, CPU-only included, so the failsafe works when everything else is missing. Every other copy derives from it.
The secondary resolves to a different model from the primary, and a startup check refuses to start if they are the same.
Acceptance criteria
The failsafe model has one SSOT default. backend.env.j2, agents.yaml and the AI-stack defaults derive from it. A test pins that the derivation is not just an equal value.
Primary and secondary differ. A test asserts the fallback is used when the primary is unavailable.
The failsafe default is in the pull list for every install type, CPU-only included.
Checked against main at merge ae35848 (the merge train, PR #20713; member #20654).
AC
Evidence
One SSOT default for the failsafe model; backend.env.j2, agents.yaml, AI-stack defaults derive from it; test pins the derivation
DELIVERED. autobot_shared/agent_model_tiers.pyAGENT_TIERS: llm_failsafe on routing, llm_failsafe_secondary on light. backend.env.j2:172,177 derive from backend_routing_model/backend_light_model (pinned by agents/failsafe_models_19733_test.py::test_the_backend_template_derives_them_from_the_tier_variables); agents.yaml and the docker env are held to the tier assignment by repo_tests/agent_model_tiers_19332_test.py::test_every_plane_states_the_model_of_the_agents_tier; the old AI-stack ai_llm_failsafe_model default is removed
Primary and secondary differ; test that the fallback is used when the primary is unavailable
DELIVERED. agents/failsafe_models.pyfailsafe_secondary_model refuses two settings naming one model; tests test_the_two_models_differ_and_every_install_pulls_both, test_the_fallback_really_asks_a_different_model
The failsafe default is in the pull list for every install type, CPU-only included
DELIVERED. llama3.2:1b and phi3:mini are in llm_cpu_models (autobot-slm-backend/ansible/roles/llm/defaults/main.yml), which the role always pulls (roles/llm/tasks/main.yml:41-42); pinned by test_the_two_models_differ_and_every_install_pulls_both. Both are also pulled for GPU hosts, since GPU models are added to the CPU list
#20654 landed in train #20713 (main ae35848bb7; PR head 0b4115eec4 is an ancestor of main). I checked each criterion against merged code:
Criterion
Evidence on main
One SSOT default, derived, with a test that pins derivation
autobot_shared/agent_model_tiers.py maps llm_failsafe to the routing tier and llm_failsafe_secondary to the light tier. agents/failsafe_models.py reads them through TIER_MODELS[AGENT_TIERS[...]] when the env is unset. backend.env.j2 references backend_routing_model and backend_light_model, and test_the_backend_template_derives_them_from_the_tier_variables pins those references, not just the values. agents.yaml is held to the tier by repo_tests/agent_model_tiers_19332_test.py::test_every_plane_states_the_model_of_the_agents_tier. The AI-stack template states no model, so the agent falls back to the tier table.
Primary and secondary differ, and the fallback is used
test_the_two_models_differ_and_every_install_pulls_both asserts primary != secondary. test_the_fallback_really_asks_a_different_model asserts the calls are ["first", "second"] and the result comes from LLMTier.SECONDARY. failsafe_secondary_model raises AgentConfigurationError when both settings name one model.
In the pull list for every install type, CPU-only included
The same test asserts both models are in roles/llm/defaults/main.ymlllm_cpu_models. roles/llm/tasks/main.yml:42 pulls llm_cpu_models always, plus the GPU list only when a GPU is detected.
All three are ticked. The issue stays open: gate 4 (delivery through the builtin updater) holds for the backend (backend/tasks/env_only.yml re-renders backend.env.j2 on update) but not for the AI stack. The updater runs ai-stack with tasks_from: code_only, which never renders ai-stack.env.j2, so the new AUTOBOT_LLM_FAILSAFE_PROVIDER/_ENDPOINT settings reach only fresh installs. I filed that as #20724 and recorded it as blocking this issue.
Activity
fix(llm): a failed answer counts as failed, and an existing host keep…
fix(llm): the ai-stack service keeps its failsafe settings, from the …
test(llm): the ai-stack lines reference the right values (#19733)
fix(llm): the failsafe needs no stated model, so the role adds no lit…
mrveiss commentedon Nov 3, 2026
Checked against
mainat merge ae35848 (the merge train, PR #20713; member #20654).backend.env.j2,agents.yaml, AI-stack defaults derive from it; test pins the derivationautobot_shared/agent_model_tiers.pyAGENT_TIERS:llm_failsafeonrouting,llm_failsafe_secondaryonlight.backend.env.j2:172,177derive frombackend_routing_model/backend_light_model(pinned byagents/failsafe_models_19733_test.py::test_the_backend_template_derives_them_from_the_tier_variables);agents.yamland the docker env are held to the tier assignment byrepo_tests/agent_model_tiers_19332_test.py::test_every_plane_states_the_model_of_the_agents_tier; the old AI-stackai_llm_failsafe_modeldefault is removedagents/failsafe_models.pyfailsafe_secondary_modelrefuses two settings naming one model; teststest_the_two_models_differ_and_every_install_pulls_both,test_the_fallback_really_asks_a_different_modelllama3.2:1bandphi3:miniare inllm_cpu_models(autobot-slm-backend/ansible/roles/llm/defaults/main.yml), which the role always pulls (roles/llm/tasks/main.yml:41-42); pinned bytest_the_two_models_differ_and_every_install_pulls_both. Both are also pulled for GPU hosts, since GPU models are added to the CPU listmrveiss commentedon Nov 3, 2026
Every acceptance criterion is ticked with evidence from
mainat merge ae35848 (the merge train, PR #20713); see the table above.mrveiss commentedon Nov 3, 2026
#20654 landed in train #20713 (main
ae35848bb7; PR head0b4115eec4is an ancestor of main). I checked each criterion against merged code:mainautobot_shared/agent_model_tiers.pymapsllm_failsafeto the routing tier andllm_failsafe_secondaryto the light tier.agents/failsafe_models.pyreads them throughTIER_MODELS[AGENT_TIERS[...]]when the env is unset.backend.env.j2referencesbackend_routing_modelandbackend_light_model, andtest_the_backend_template_derives_them_from_the_tier_variablespins those references, not just the values.agents.yamlis held to the tier byrepo_tests/agent_model_tiers_19332_test.py::test_every_plane_states_the_model_of_the_agents_tier. The AI-stack template states no model, so the agent falls back to the tier table.test_the_two_models_differ_and_every_install_pulls_bothasserts primary != secondary.test_the_fallback_really_asks_a_different_modelasserts the calls are["first", "second"]and the result comes fromLLMTier.SECONDARY.failsafe_secondary_modelraisesAgentConfigurationErrorwhen both settings name one model.roles/llm/defaults/main.ymlllm_cpu_models.roles/llm/tasks/main.yml:42pullsllm_cpu_modelsalways, plus the GPU list only when a GPU is detected.All three are ticked. The issue stays open: gate 4 (delivery through the builtin updater) holds for the backend (
backend/tasks/env_only.ymlre-rendersbackend.env.j2on update) but not for the AI stack. The updater runsai-stackwithtasks_from: code_only, which never rendersai-stack.env.j2, so the newAUTOBOT_LLM_FAILSAFE_PROVIDER/_ENDPOINTsettings reach only fresh installs. I filed that as #20724 and recorded it as blocking this issue.fix(llm): the failsafe has a real fallback, on models every install p…