installer-setup WS-I: converge /apply onto /apply-selections + write first-run sentinel from endpoint#1124
Merged
Merged
Conversation
…first-run sentinel from endpoint Only the CLI in-process apply path wrote the first-run sentinel; a UI or answer-file client that never POSTs /complete left first_run oscillating on the has_models heuristic alone. /apply and /apply-selections now share one provisioning core (_apply_selections_core), and that core writes the sentinel on success — so any successful apply, regardless of caller, converges with the CLI path. Closes #1101 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.
Summary
Closes #1101.
/apply(tier-manifest) and/apply-selections(raw selections) now both delegate to a single new_apply_selections_corehelper insrc/hal0/api/routes/installer.py— theapply_setupcall and background-pull scheduling live in exactly one place./applyis now a thin tier→selections adapter (_bundle_to_selections) over that shared core, matching the pattern/apply-selectionsalready used._apply_selections_corenow callsapply_setup(..., write_sentinel=True)(previously both routes passedwrite_sentinel=Falseand relied on the wizard UI explicitly callingPOST /api/install/complete). A UI client that never calls/complete, or an answer-file/API-uphal0 setupinstall, previously leftfirst_rundepending only on thehas_modelsheuristic. Now any successful apply — CLI in-process,/apply, or/apply-selections— writes the sentinel itself.mark_first_run_done()is idempotent, so the wizard's existingPOST /completecall after apply remains a harmless no-op — no behavior change there./applystill returns{tier, model_ids, slots, next},/apply-selectionsstill returns{model_ids, slots}.setup_command.py,answers.py,setup_plan.py,setup_install.py, or add any/api/config/urlsroute (owned by sibling PR installer-setup WS-C: network coherence backend (unify HAL0_BIND_HOST + seed origins/hostname) #1099).Test plan
uv run ruff format src tests— 1 file reformatted (test file), rest unchangeduv run ruff check src tests— all checks passeduv run ruff format --check src tests— all files already formatteduv run pytest tests/api/test_installer_routes.py tests/api/test_install_apply.py tests/api/test_apply_selections.py tests/install/test_orchestrate.py -q— 34 passeduv run pytest tests/ -q --ignore=tests/e2e— 4617 passed, 14 failed, 1 error, all pre-existing/unrelated (hermes venv/wrapper, comfyui phase4, proxmox host detection, container spec dispatch, config-url-proxy, models-preview, settings-store, openwebui prewire smoke)tests/api/test_install_apply.py::test_apply_writes_first_run_sentinel—/applywrites the sentinel and flipsfirst_runwithout anyPOST /complete.tests/api/test_install_apply.py::test_apply_delegates_to_apply_selections_core— asserts/applycalls the shared_apply_selections_core(spies on it).tests/api/test_apply_selections.py::test_apply_selections_writes_first_run_sentinel—/apply-selectionswrites the sentinel and flipsfirst_run.🤖 Generated with Claude Code