Skip to content

fix(models): keep registered-store reloads idempotent - #6992

Closed
tang-vu wants to merge 1 commit into
Osmantic:mainfrom
tang-vu:fix/model-store-reload-idempotence
Closed

tang-vu wants to merge 1 commit into
Osmantic:mainfrom
tang-vu:fix/model-store-reload-idempotence

Conversation

@tang-vu

@tang-vu tang-vu commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Retrying a completed activation of a model in a registered SSD/model store now returns already_active without restarting inference. The dashboard uses its existing unique installed-artifact resolver for the idempotence check, matching discovery and activation.

Why this matters

useModels.loadModel explicitly permits the server to complete while the browser connection disappears. A retry from Models (Models.jsx) or Portal (PortalModelSelector.jsx) therefore reaches authenticated POST /api/models/{id}/load with the same model and context. Previously the check searched only data/models, so a registered-store model with matching live identity and a completed activation receipt triggered another host activation. During an active Portal response, the same harmless retry incorrectly returned pixel_chat_active.

The shared resolver also rejects missing artifacts and ambiguous basenames rather than treating an unrelated default-store file as evidence that activation is complete. Existing live identity, configuration, receipt, and context checks remain required.

Overlap check

Searched open and closed upstream PRs for model recovery, active model, model store, idempotence, and reload. Inspected changed files for #6738/#6735 (interrupted transaction and Docker timeout recovery), #3307 (state endpoint tests), and #6401/#6370/#6378/#5881/#5874 (registry/scripts parsing). None covers this reload defect. #6990 also edits routers/models.py, but changes only benchmark transport; this PR changes only _configured_model_identity_matches and separate authenticated load regressions.

Validation

Base: upstream main 9b95d08ae9e9f79af8410dfcea442df6b99db0ba. Environment: native Windows, PowerShell 5.1, Python 3.14.2 with -X utf8.

From ods/extensions/services/dashboard-api:

  • python -X utf8 -m pytest tests/test_models.py -q -k unique_installed_artifact: old code 4 failed, 2 passed; fixed code 6 passed. Uses a real registry, registered artifact, matching live identity and completed receipt, through the authenticated HTTP boundary. Covers registered/missing/ambiguous files with Portal idle and active.
  • python -X utf8 -m pytest tests/test_models.py tests/test_model_stores.py tests/test_model_recovery_api.py tests/test_model_state.py tests/test_model_routes.py -q: 202 passed, 1 skipped, 1 failed. The failure is the existing test_collision_and_link_escape_never_select_arbitrary_checkpoint fixture: Windows cannot create its symlink (WinError 1314). The fixture's collision assertion ran successfully before that environmental failure.
  • Root independently validated the combined fix(models): benchmark the observed model through its installed inference route #6990 benchmark transport change and this resolver fix: 194 passed, 1 skipped, 1 deselected, excluding the existing Windows symlink privilege fixture. A final focused combination including this container-portable fixture, fix(models): benchmark the observed model through its installed inference route #6990 benchmark tests and the independently audited update-status regressions passed 94 tests. Evidence: round3/combined-final.txt in the local QA receipts.
  • Scoped pre-commit secrets, private-key and file-size checks passed; git diff --check passed.

No clean installation, Docker, GPU inference, container mounts, or browser end-to-end validation was performed. The host-agent call is observed/mocked at the HTTP boundary; this verifies suppression of redundant activation and preservation of busy-response protection, without claiming live restart behavior.

GitHub CI completed on head dd0d4419d910dd86128bdd87140842ee2e5d21e7: 60 passed, 4 skipped, 0 failed or pending. This includes the dashboard API suite, integration smoke, Python lint/type checks, frontend builds on Linux/macOS/Windows, and platform/contract jobs. Automated checks do not replace the live installation and inference validation limits above.

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.

1 participant