Conversation
Scans of repositories with more than 65,535 files crashed instead of falling back to the batched upload. The archive was built with allowZip64=False, so zipfile raised LargeZipFile - which the caller did not catch, because the only guard there was the archive's byte size. Enable ZIP64 on 64-bit interpreters, route to the batched upload when a single archive provably cannot hold the documents, and log which upload mode was selected and why. Also take the archive off the heap: it is now built into a SpooledTemporaryFile that stays in memory below 64 MB and spills into ~/.cycode/tmp beyond it, and the archive built to check that everything fits is reused for the upload instead of being thrown away and rebuilt. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…35-files-instead-of-falling-back-to-batched-upload
mateusz-sterczewski
approved these changes
Sep 16, 2026
avishaiamiel
approved these changes
Sep 17, 2026
…35-files-instead-of-falling-back-to-batched-upload
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptoms
Scans of repositories with more than 65,535 files crashed instead of falling back to the batched upload.
Root cause
Zip archive building sets
allowZip64=False, so zipfile raised LargeZipFile - which the caller did not catch, because the only guard there was the archive's byte size.Fix
Enable ZIP64 on 64-bit interpreters, route to the batched upload when a single archive provably cannot hold the documents, and log which upload mode was selected and why.
Take the archive off the heap: it is now built into a SpooledTemporaryFile that stays in memory below 64 MB and spills into
<config dir>/tmpbeyond it, and the archive built to check that everything fits is reused for the upload instead of being thrown away and rebuilt.