Thanks to visit codestin.com
Credit goes to github.com

Skip to content

installer-setup WS-I: converge /apply onto /apply-selections + write first-run sentinel from endpoint#1124

Merged
thinmintdev merged 1 commit into
mainfrom
feat/1101-converge-apply
Jul 6, 2026
Merged

installer-setup WS-I: converge /apply onto /apply-selections + write first-run sentinel from endpoint#1124
thinmintdev merged 1 commit into
mainfrom
feat/1101-converge-apply

Conversation

@thinmintdev

Copy link
Copy Markdown
Contributor

Summary

Closes #1101.

  • /apply (tier-manifest) and /apply-selections (raw selections) now both delegate to a single new _apply_selections_core helper in src/hal0/api/routes/installer.py — the apply_setup call and background-pull scheduling live in exactly one place. /apply is now a thin tier→selections adapter (_bundle_to_selections) over that shared core, matching the pattern /apply-selections already used.
  • _apply_selections_core now calls apply_setup(..., write_sentinel=True) (previously both routes passed write_sentinel=False and relied on the wizard UI explicitly calling POST /api/install/complete). A UI client that never calls /complete, or an answer-file/API-up hal0 setup install, previously left first_run depending only on the has_models heuristic. 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 existing POST /complete call after apply remains a harmless no-op — no behavior change there.
  • Response shapes are unchanged: /apply still returns {tier, model_ids, slots, next}, /apply-selections still returns {model_ids, slots}.
  • Did not touch setup_command.py, answers.py, setup_plan.py, setup_install.py, or add any /api/config/urls route (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 unchanged
  • uv run ruff check src tests — all checks passed
  • uv run ruff format --check src tests — all files already formatted
  • uv 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 passed
  • uv 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)
  • New tests added:
    • tests/api/test_install_apply.py::test_apply_writes_first_run_sentinel/apply writes the sentinel and flips first_run without any POST /complete.
    • tests/api/test_install_apply.py::test_apply_delegates_to_apply_selections_core — asserts /apply calls the shared _apply_selections_core (spies on it).
    • tests/api/test_apply_selections.py::test_apply_selections_writes_first_run_sentinel/apply-selections writes the sentinel and flips first_run.

🤖 Generated with Claude Code

…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]>
@thinmintdev thinmintdev merged commit 0b4ee97 into main Jul 6, 2026
3 checks passed
@thinmintdev thinmintdev deleted the feat/1101-converge-apply branch July 6, 2026 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

installer-setup WS-I: converge /apply onto /apply-selections + write first-run sentinel from endpoint

1 participant