Skip to content

deploy(updater): the AI-stack env file is never re-rendered on update, so ai-stack.env.j2 changes reach only fresh installs #20724

Open

Description

@mrveiss

Problem

The builtin updater never re-renders the AI-stack environment file. A setting added to roles/ai-stack/templates/ai-stack.env.j2 reaches a host only on a full install, never on an update.

Evidence on main:

The backend has the equivalent path already: roles/backend/tasks/env_only.yml re-renders backend.env.j2 on every update ("[PLAY 2] Backend | Regenerate .env from template (#2649, #12871)").

Impact

#20654 (for #19733) added AUTOBOT_LLM_FAILSAFE_PROVIDER and AUTOBOT_LLM_FAILSAFE_ENDPOINT to ai-stack.env.j2. The test docstring in autobot-backend/agents/failsafe_models_19733_test.py says the AI-stack server creates ClassificationAgent, which raises without them. An updated host doesn't get them, so the fix is not delivered there (CLAUDE_CLOSURE gate 4, #12959). The same applies to every past and future change to that template.

Not checked: whether an updated AI-stack host is failing today. That needs host evidence.

Acceptance criteria

  • The updater re-renders the AI-stack env file on every update, using the same template task main.yml uses (tasks_from, not a second copy of the task), so the two cannot drift.
  • A test pins that the updater's AI-stack play reaches the task that renders ai-stack.env.j2.
  • Host evidence: after an update through the builtin updater, the AI-stack env file on an AI-stack node contains AUTOBOT_LLM_FAILSAFE_PROVIDER.

Found while closing out #19733.

Activity

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

    @mrveiss
    OwnerAuthor

    Host check from #20730's review, read-only, on a host running ansible-core 2.17.14: what does a no-restart sync's --tags !restart do, and does restart ai-stack still fire?

    • --tags !restart does not exclude anything. Ansible reads !restart as a literal tag name, so only tasks tagged always run. A probe playbook ran only its always task: no config task, no handler. In update-all-nodes.yml, that is 4 of 88 tasks. A no-restart sync therefore doesn't run this issue's env render at all, and deploys no code.
    • --skip-tags restart, the form that excludes, ran the config task and the always task, and the notified handler. Handlers aren't filtered by task tags, so restart ai-stack would still fire once that path is fixed.

    Both are filed as #20743. It's outside #20724: this fix is reached by the normal sync, which passes no tags.

  3. github-actions commented on Nov 3, 2026

    @github-actions
    Contributor

    Landed via the merge train (#20768, merge 6e4e33da91) via #20730

  4. mrveiss commented on Nov 3, 2026

    @mrveiss
    OwnerAuthor

    Acceptance criteria after merge train #20768

    Checked against origin/main.

    Criterion Verdict Evidence
    Updater re-renders the AI-stack env file on every update, via tasks_from, not a second copy of the task met autobot-slm-backend/ansible/roles/ai-stack/tasks/code_only.yml:20-22 include_tasks: env_files.yml; the render lives only in roles/ai-stack/tasks/env_files.yml:82 ("AI Stack
    A test pins that the updater's AI-stack play reaches the task that renders ai-stack.env.j2 met autobot-slm-backend/tests/test_ai_stack_env_rerendered_on_update_20724.py:42 test_the_updater_reaches_both_env_renders, :65 test_there_is_one_copy_of_the_render, :82 covers a config-tags-only run.
    Host evidence: after a builtin update, the AI-stack node's env file contains AUTOBOT_LLM_FAILSAFE_PROVIDER needs host evidence Requires a real update on an AI-stack node.

    Issue stays open: 2 of 3 met.

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