A cached file checked as another is refused and left, not deleted for the next model

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-10-30 08:17:43 +01:00
1 parent b8ed368e31
commit 73091d7c97
2 files changed
+31 -1

No files matched your search

+9 -1
View File
@@ -230,9 +230,17 @@ func (f *Fetcher) fetchChecked(ctx context.Context, source, target, want string)
// the checksum kept beside it, or worked out once and then kept. One that
// is not is deleted, to be fetched again. Any file is, when want is empty.
func (f *Fetcher) cachedIs(target, want string) (bool, error) {
if want == "" || readChecksum(target) == want {
kept := readChecksum(target)
if want == "" || kept == want {
return true, nil
}
if kept != "" {
// Checked when it was fetched, as another file: the same address
// gives the same bytes again, and another model may be serving
// these. Refused, and left.
return false, fmt.Errorf("the copy of this file here has sha256 %s, as fetched, and the catalog names %s: refused",
kept, want)
}
sum, err := fileSHA256(target)
if err != nil {
return false, err