The /delete-cached guard refused deleting a cached repo whose id is a bare prefix of the loaded one: with Qwen/Qwen-Image-2512 loaded, deleting the separate cached Qwen/Qwen-Image returned 400 "Unload the model before deleting" because loaded_id.startswith(repo_id) matched across the repo boundary. Both are real, independently cached catalog artifacts, so a supported delete was wrongly blocked. Add a /-boundary aware _loaded_id_matches_repo helper (mirroring hub/services/models/deletion.py) and use it at all six guard sites (chat, Images, Video, and their in-flight loading-id loops), so only the loaded repo itself or a file within it blocks deletion. Add a regression test covering the sibling-prefix pair. |
||
|---|---|---|
| .. | ||
| assets | ||
| auth | ||
| core | ||
| hub | ||
| loggers | ||
| models | ||
| plugins | ||
| requirements | ||
| routes | ||
| state | ||
| storage | ||
| tests | ||
| utils | ||
| __init__.py | ||
| _platform_compat.py | ||
| cloudflare_tunnel.py | ||
| colab.py | ||
| main.py | ||
| run.py | ||
| startup_banner.py | ||