Skip to content

fix(model-install): keep restored downloads restartable - #9521

Open
primorLee wants to merge 1 commit into
invoke-ai:mainfrom
primorLee:codex/fix-restored-install-restart
Open

fix(model-install): keep restored downloads restartable#9521
primorLee wants to merge 1 commit into
invoke-ai:mainfrom
primorLee:codex/fix-restored-install-restart

Conversation

@primorLee

Copy link
Copy Markdown

Summary

Fix restored installs that receive a non-resumable response before their first download-started signal.

  • Share a newly-created multifile download's parts with the public install job before queue submission
  • Keep pre-start resume_required state visible to the API and available to the install marker and restart path
  • Add a regression covering enqueue, pre-start cancellation, public serialization, marker persistence, and restart

Related Issues / Discussions

Closes #9480

QA Instructions

uv run --frozen --extra test pytest tests/app/services/model_install/test_model_install.py::test_restart_failed_uses_parts_created_before_download_started -q
INVOKEAI_ALLOW_PRIVATE_DOWNLOAD_URLS=true uv run --frozen --extra test pytest tests/app/services/model_install/test_model_install.py -q
INVOKEAI_ALLOW_PRIVATE_DOWNLOAD_URLS=true ./.venv/bin/pytest tests/app/services/download/test_download_queue.py -q -k 'not download_refuses_non_public_source and not download_refuses_redirect_to_non_public_address and not rejected_redirect_closes_streamed_response and not download_refuses_multi_hop_redirect_to_non_public_address'
./.venv/bin/pytest tests/app/services/download/test_download_queue.py::test_download_refuses_non_public_source tests/app/services/download/test_download_queue.py::test_download_refuses_redirect_to_non_public_address tests/app/services/download/test_download_queue.py::test_rejected_redirect_closes_streamed_response tests/app/services/download/test_download_queue.py::test_download_refuses_multi_hop_redirect_to_non_public_address -q
./.venv/bin/ruff check invokeai/app/services/model_install/model_install_default.py tests/app/services/model_install/test_model_install.py
./.venv/bin/ruff format --check invokeai/app/services/model_install/model_install_default.py tests/app/services/model_install/test_model_install.py

The focused regression passes, the full model-install test file passes 36 tests, and the related download-queue file passes all 36 tests when split between its mocked private-address cases and its four default-policy SSRF refusal cases. The split is needed locally because the sandbox maps public test hostnames into the reserved 198.18.0.0/15 range.

Merge Plan

No special merge sequencing is required.

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • Redux migration is not applicable; no redux slice changed
  • Documentation is not applicable; behavior and public interfaces are unchanged
  • What's New copy is not applicable; this is not a release PR

@github-actions github-actions Bot added python PRs that change python files services PRs that change app services python-tests PRs that change python tests labels Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python PRs that change python files python-tests PRs that change python tests services PRs that change app services

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restored install that pauses before its first download-started signal cannot be restarted (restart_failed no-ops, marker loses resume metadata)

1 participant