Skip to content

bug(llm): the failsafe agent has three disagreeing defaults and no real fallback — primary and secondary resolve to the same model #19733

Closed

Description

@mrveiss

Problem

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.

Activity

  1. added
    bugSomething isn't working
    phase:M1.4Wizard and SLM: choose a mode, apply it, default models work
    on Oct 26, 2026
  2. mrveiss commented on Nov 3, 2026

    @mrveiss
    OwnerAuthor

    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.py AGENT_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.py failsafe_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
  3. mrveiss commented on Nov 3, 2026

    @mrveiss
    OwnerAuthor

    Every acceptance criterion is ticked with evidence from main at merge ae35848 (the merge train, PR #20713); see the table above.

  4. mrveiss commented on Nov 3, 2026

    @mrveiss
    OwnerAuthor

    #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.yml llm_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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendbugSomething isn't workingphase:M1.4Wizard and SLM: choose a mode, apply it, default models workpriority: high

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions