Summary
When creating trees with many text files, chunks by entry count only (TREE_ENTRY_CHUNK_SIZE = 100). It does not account for total request payload size, which is dominated by inline content for text entries.
A chunk of 100 large text files could theoretically exceed GitHub's request body limits. Additionally, very large individual text files could be more safely handled via createBlob with base64 encoding than inlined.
Proposed Enhancements
-
Payload-size-aware chunking: When building chunks, track approximate serialized size (bytes) and start a new chunk when approaching the limit (e.g., GitHub's ~100 MB request body limit).
-
Per-file size threshold fallback: For text files above a configurable size threshold (e.g., 1 MB), use createBlob with base64 instead of inline content to reduce risk of oversized requests and simplify chunking logic.
Context
Raised in PR #21 Copilot review (comment on createTreeChained). Deferred from that PR because:
- Typical action payloads are small files
- Adds implementation complexity
- Low probability in current use cases
Related
Summary
When creating trees with many text files, chunks by entry count only (
TREE_ENTRY_CHUNK_SIZE = 100). It does not account for total request payload size, which is dominated by inlinecontentfor text entries.A chunk of 100 large text files could theoretically exceed GitHub's request body limits. Additionally, very large individual text files could be more safely handled via
createBlobwith base64 encoding than inlined.Proposed Enhancements
Payload-size-aware chunking: When building chunks, track approximate serialized size (bytes) and start a new chunk when approaching the limit (e.g., GitHub's ~100 MB request body limit).
Per-file size threshold fallback: For text files above a configurable size threshold (e.g., 1 MB), use
createBlobwith base64 instead of inlinecontentto reduce risk of oversized requests and simplify chunking logic.Context
Raised in PR #21 Copilot review (comment on
createTreeChained). Deferred from that PR because:Related