installer-setup WS-A: thread HF_TOKEN through apply_setup → in-process pulls#1122
Merged
Conversation
_apply_in_process (hal0 setup --auto, install time, API down) called apply_setup() without hf_token, so it always defaulted to None even when HF_TOKEN/HUGGING_FACE_HUB_TOKEN was exported. Gated curated model pulls then 401'd during a fresh install. Read the token from env with the same precedence the API route already uses (HF_TOKEN, then HUGGING_FACE_HUB_TOKEN fallback, else None) and pass it into apply_setup so run_pull authenticates for gated pulls, matching the API-up path. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1094
Description
Install-time in-process model pulls (
hal0 setup --autowhen hal0-api is not up) calledapply_setup()withouthf_token, so it always defaulted toNone— even whenHF_TOKEN(orHUGGING_FACE_HUB_TOKEN) was exported in the environment. This caused gated curated model pulls to 401 during a fresh install.The API path (
src/hal0/api/routes/installer.py) already readsos.environ.get("HF_TOKEN") or os.environ.get("HUGGING_FACE_HUB_TOKEN")and threads it intoapply_setup(hf_token=...). This PR mirrors that exact precedence in_apply_in_process(src/hal0/cli/setup_install.py), so the in-process path now reaches parity with the API-up path.apply_setupinsrc/hal0/install/orchestrate.pyalready acceptedhf_token: str | None = Noneand threads it intomake_job/PullPlan.kwargs— no changes needed there.Acceptance checklist
HF_TOKENpresent in the environment reachesrun_pullfor install-time in-process pullsHF_TOKENthenHUGGING_FACE_HUB_TOKENfallback, elseNone)hf_token=Noneisapply_setup's own default)None):HF_TOKENset,HUGGING_FACE_HUB_TOKENfallback, and neither-set →NoneTest plan
uv run ruff format src tests— cleanuv run ruff check src tests— all checks passeduv run ruff format --check src tests— cleanuv run pytest tests/cli/test_setup_install.py tests/install/test_orchestrate.py -q— 12 passeduv run pytest tests/ -q --ignore=tests/e2e— 4617 passed, 14 pre-existing failures unrelated to this change (hermes wrapper/state-render, comfyui phase4, proxmox host detection, container spec dispatch, config-url-proxy, models-preview, settings-store), none touchingsetup_install.py,test_setup_install.py, ororchestrate.py🤖 Generated with Claude Code