• Stefy Lanza (nextime / spora )'s avatar
    a failed download must not become a permanent cache hit · 939a1f1c
    Stefy Lanza (nextime / spora ) authored
    download_model wrote straight to its final cache path with no try/except and no
    .partial, and the check guarding it tested existence only. So any interruption
    left a file that was then returned for ever as a valid cached model, and that
    URL could never be fetched again.
    
    Measured in one cache directory on zeiss: 188 zero-byte `<sha256>_<name>.gguf`
    entries accruing about 14 a day since 2026-10-16, against 2 non-empty files. And
    one of those two was a 9.72 GB ltx-2.5-22b-distilled-Q4_K_M.gguf where the real
    file is 13.58 GB — a truncated download the existence-only check would have
    served as a complete model. The empty ones break a load loudly; the truncated one
    loads.
    
    Now: the bytes go to a .partial and are renamed only once they are all there, an
    empty or short transfer raises instead of being kept, and the partial is removed
    on BaseException — not Exception, because a KeyboardInterrupt or SIGTERM
    mid-download is exactly how several of these were made. A zero-byte entry found
    in the cache is treated as a miss and deleted rather than served.
    
    The cache LOCATION is deliberately untouched: moving it would be a silent full
    re-download for every existing install, and a test pins the resolution order.
    Where it points on a given box is a deployment question — on this one a root
    symlink chain (~/.cache/coderai -> /AI/coderai -> /storage/coderai/) aims it at
    the repo's gitignored models/ dir, which is a separate matter from this bug.
    Co-Authored-By: 's avatarClaude Opus 5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_014T3rZozi1Ehk96NG1WesgC
    939a1f1c
Name
Last commit
Last update
codai Loading commit data...
docs Loading commit data...
packaging Loading commit data...
samples Loading commit data...
tests Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.dockerignore Loading commit data...
.gitignore Loading commit data...
AI.PROMPT Loading commit data...
CODERAI_API_DOCUMENTATION.md Loading commit data...
CoderAI.gif Loading commit data...
DISTRIBUTION.md Loading commit data...
LICENSE.md Loading commit data...
MULTIMODAL_CAPABILITIES.md Loading commit data...
MULTIMODAL_UI_EXAMPLES.md Loading commit data...
README.md Loading commit data...
REQUEST-geoclip-embeddings.md Loading commit data...
REQUEST-vpr-embeddings.md Loading commit data...
amdgpu-coredump-05000.bin Loading commit data...
build-oci.sh Loading commit data...
build.ps1 Loading commit data...
build.sh Loading commit data...
coderai Loading commit data...
coderai-broker-implementation-reference.md Loading commit data...
coderai-integration.md Loading commit data...
commands Loading commit data...
osxbuild.sh Loading commit data...
package-oci.sh Loading commit data...
package-tarball.sh Loading commit data...
requirements-acestep.txt Loading commit data...
requirements-crisperwhisper.txt Loading commit data...
requirements-h3.txt Loading commit data...
requirements-latentsync.txt Loading commit data...
requirements-longcat-train.txt Loading commit data...
requirements-longcat.txt Loading commit data...
requirements-melotts.txt Loading commit data...
requirements-musetalk.txt Loading commit data...
requirements-nemo.txt Loading commit data...
requirements-nvidia.txt Loading commit data...
requirements-ocr-paddle.txt Loading commit data...
requirements-ocr.txt Loading commit data...
requirements-parler.txt Loading commit data...
requirements-pyannote.txt Loading commit data...
requirements-surya.txt Loading commit data...
requirements-vllm.txt Loading commit data...
requirements-vulkan.txt Loading commit data...
requirements-xtts.txt Loading commit data...
requirements.txt Loading commit data...
run-oci.sh Loading commit data...
smoke-test-oci.sh Loading commit data...
todo.md Loading commit data...