Skip to content

bug(install): every node-side venv builder must use the declared floor interpreter, not bare python3 (SLM installers, slm_agent, enroll-node, ...) #20932

Open

Description

@mrveiss

Finding

The two SLM installers create the SLM backend venv with bare python3. On a host where python3 is older than the project floor declared in .python-version (3.14), the SLM gets a venv below that floor.

Sites (verified against origin/main @ 7b3358f)

Installer Line Code
autobot-infrastructure/autobot-slm-backend/scripts/bootstrap-slm.sh 395 remote_exec_sudo "python3 -m venv ${REMOTE_BACKEND}/venv"
autobot-infrastructure/shared/scripts/install-slm.sh 382 sudo -u autobot python3 -m venv "$SLM_SERVER_DIR/venv"

The drift guard repo_tests/python_version_declaration_drift_test.py does not sweep either installer: _SWEEPS covers only the docker ARG PYTHON_VERSION defaults and pyproject.toml's python_version.

Scope (widened; maintainer ruling): EVERY node-side venv builder

The two installers are kept. The scope now also covers every builder in the table in the rollout comment on this issue: the slm_agent role (roles/slm_agent/tasks/main.yml:139), both enroll-node paths (playbooks/enroll-node.yml:268, :285), dependency_patching (update-venv.yml:84, :93), deploy-autobot-native.sh:179, deploy_autobot.py:226, setup_repair.sh:439, code_analysis/install.sh:66, plus the roles that hard-code python3.14 for the create step (npu-worker, tts-worker, agent_config, backend, ai-stack, slm_manager, redis/chromadb, deploy-native-services). Each builds with the floor interpreter derived from .python-version, using the python_interpreter role pattern (python_interpreter_binary), not bare python3 and not a literal.

Blocks #20903 / #20929: #20929 boards only after this lands, or host evidence shows every node venv is 3.14 or newer.

Impact

Once #20929 lands, a venv below the floor is refused at import by autobot_shared (per #20929's refusal of interpreters below the .python-version floor). A fresh SLM install on a host with an older system python3 therefore produces a venv that the SLM backend cannot import.

Canonical pattern to mirror

The backend Ansible role is the reference:

  • autobot-slm-backend/ansible/roles/python_interpreter/ derives the interpreter from .python-version (tasks/main.yml).
  • It provisions python3.14 when it is missing (the deadsnakes step in install.sh).

Both installers should use the same derivation and provisioning rather than python3.

Overlap and ordering

install-slm.sh is also touched by open PRs #20777 and #20587 (both verified to modify that file). The fix to install-slm.sh lands after them to avoid conflicts.

Acceptance criteria

  • Both installers derive the interpreter from .python-version and provision it if it is missing.
  • The drift guard repo_tests/python_version_declaration_drift_test.py sweeps both installers.
  • Every node-side venv builder in the rollout table builds with the floor interpreter derived from .python-version (the python_interpreter role pattern); none uses bare python3 or a restated literal.
  • Each of those builders is swept by repo_tests/python_version_declaration_drift_test.py (min_files and min_declarations floors, plus a planted-drift control).
  • Host evidence comes from a fresh SLM install (venv interpreter version and SLM backend import output).

Related

Activity

  1. added
    bugSomething isn't working
    phase:M1.1install.sh completes, fails loudly and is safe
    on Nov 6, 2026
  2. mrveiss commented on Nov 6, 2026

    @mrveiss
    OwnerAuthor

    Rollout evidence for #20929 (read-only; component names only, no paths or hosts).

    Live venvs on the test host (interpreter version of each venv): autobot-ai-stack, autobot-backend, autobot-browser-worker, autobot-npu-worker, autobot-slm-agent, autobot-slm-backend, autobot-tts-worker, autobot-db-stack/chromadb are all 3.14.6; all 10 retained backend/SLM snapshots are also 3.14.6. None is below the floor. This is one host; it says nothing about nodes that were enrolled earlier or by a different path.

    Node-side venv builders in the repo (origin/main at the time of the check). Floor interpreter = derived from .python-version via the python_interpreter role (python_interpreter_binary); literal = hard-coded python3.14 (right today, drifts on a floor bump); bare = python3, whatever the node ships.

    Builder Site Interpreter
    slm_agent role (agent venv, pip) roles/slm_agent/tasks/main.yml:139 bare python3
    enroll-node, npu-worker playbooks/enroll-node.yml:268 bare python3
    enroll-node, ai-stack playbooks/enroll-node.yml:285 bare python3
    dependency_patching (pip into any host venv) roles/dependency_patching/tasks/update-venv.yml:84, :93 bare python3
    deploy-autobot-native.sh deploy-autobot-native.sh:179 bare python3
    deploy_autobot.py autobot-infrastructure/shared/scripts/deploy_autobot.py:226 bare python3
    setup_repair.sh autobot-infrastructure/shared/scripts/setup/setup_repair.sh:439 bare python3
    code_analysis install.sh autobot-backend/code_analysis/install.sh:66 bare python3
    bootstrap-slm.sh autobot-infrastructure/autobot-slm-backend/scripts/bootstrap-slm.sh:395 bare python3
    install-slm.sh autobot-infrastructure/shared/scripts/install-slm.sh:382 bare python3
    npu-worker role roles/npu-worker/tasks/main.yml:172 (create), :194, :233 (pip) literal python3.14 create; floor-derived pip
    tts-worker role roles/tts-worker/tasks/main.yml:171 (create), :193, :218, :264, :330 (pip) literal python3.14 create; floor-derived pip
    agent_config roles/agent_config/tasks/python_env.yml:22 (create), :34; python_deps.yml:32; openvino.yml:100; playwright.yml:54 literal python3.14 create; floor-derived pip
    backend role roles/backend/tasks/main.yml:851, :880, :892, :973 literal python3.14
    ai-stack role roles/ai-stack/tasks/main.yml:93, :129, :224 literal python3.14
    slm_manager role roles/slm_manager/tasks/main.yml:302, :411 literal python3.14
    redis/chromadb roles/redis/tasks/chromadb.yml:34, :48, :74 literal python3.14
    deploy-native-services.yml :442, :477, :638 literal python3.14
    browser, backend_services roles/browser/tasks/main.yml:192, roles/backend_services/tasks/main.yml:71 floor-derived
    model_prefetch roles/backend/tasks/prefetch_models.yml:16, :29 no builder: runs the backend venv

    Finding: the tasks that build a venv with bare python3 are the slm_agent role, both enroll-node paths, dependency_patching (if it ever creates one), and the five scripts. A node enrolled or repaired through these on a host whose python3 is below 3.14 gets a venv that autobot_shared will refuse at import once #20929 deploys.

  3. changed the title [-]bug(install): SLM installers build the venv with bare python3 instead of the declared 3.14 floor[/-] [+]bug(install): every node-side venv builder must use the declared floor interpreter, not bare python3 (SLM installers, slm_agent, enroll-node, ...)[/+] on Nov 6, 2026
  4. mrveiss commented on Nov 6, 2026

    @mrveiss
    OwnerAuthor

    Follow-up, kept open on purpose. PR #20969 boards with install-slm.sh and playbooks/deploy-native-services.yml allowlisted in the venv-builder guard, because open PR #20777 also edits both files. Once #20777 lands, a follow-up push converts both onto the floor interpreter and removes their allowlist entries. This issue closes only after that.

  5. mrveiss commented on Nov 7, 2026

    @mrveiss
    OwnerAuthor

    PR #20969 landed via merge train #21031. Verified on main: bootstrap-slm.sh now builds the venv via python_floor_remote_venv_cmd (scripts/lib/python_floor.sh), and repo_tests/venv_builders_use_floor_interpreter_20932_test.py exists. Not done: autobot-infrastructure/shared/scripts/install-slm.sh:382 still runs bare python3 -m venv (ordered after #20777 and #20587), so no AC is ticked; the remaining builders in the rollout table were not all verified, and the host-evidence AC needs a fresh SLM install. Issue stays open.

  6. mrveiss commented on Nov 7, 2026

    @mrveiss
    OwnerAuthor

    Host evidence (2026-11-07, install at a0b419b)

    AC "Host evidence comes from a fresh SLM install (venv interpreter version and SLM backend import output)": NOT PROVEN, left unticked.

    Commands and output (read-only):

    • cat .python-version (repo) -> 3.14
    • grep ^version <node>/venv/pyvenv.cfg for ai-stack, backend, browser-worker, npu-worker, slm-agent, slm-backend, tts-worker -> all 3.14.6
    • <slm-backend venv>/bin/python --version -> Python 3.14.6; systemctl is-active for the SLM backend and the backend -> active
    • mtime of those pyvenv.cfg files: 2026-07-09 .. 2026-09-14, all older than this fix.

    What this shows: the existing venvs already run the floor interpreter. It does not show the fix's code path did it, because no venv was built after the fix landed, and this is an updated install, not a fresh one.

    Missing: a fresh SLM install (or a forced venv rebuild through the builtin updater) after this fix, with the new venv's interpreter version and the SLM backend import output. Also, the install is not a git checkout, so the deployed SHA could not be confirmed with git log or merge-base.

  7. mrveiss commented on Nov 8, 2026

    @mrveiss
    OwnerAuthor

    Code from #20777 landed on main via #21176 (merge train T96b, merge commit 250ddc4). This issue is left open: the PR used Refs, so its remaining acceptance criteria and any host-behaviour evidence (a merge is not host evidence) are not verified here.

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

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions