Skip to content

Advertise the real CAS size limits in GetCapabilities - #3160

Open
rajputdivyanshu81 wants to merge 2 commits into
TraceMachina:mainfrom
rajputdivyanshu81:feat/capabilities-size-limits
Open

rajputdivyanshu81 wants to merge 2 commits into
TraceMachina:mainfrom
rajputdivyanshu81:feat/capabilities-size-limits

Conversation

@rajputdivyanshu81

Copy link
Copy Markdown
Contributor

What and why

max_batch_total_size_bytes was a hard-coded 64 KiB, unrelated to the 4 MiB gRPC decoding limit the listener actually enforces, so clients sent most blobs over ByteStream even when a batch would have fit. max_cas_blob_size_bytes (REAPI 2.12) was always 0 ("no limit"), even when the CAS store caps blob size, as the memory store does. The batch limit now follows the listener's max_decoding_message_size (4 MiB when unset), less 1/16 for per-blob framing. max_cas_blob_size_bytes is the CAS store's max_upload_size() (#3097), or 0 when the store has no limit, as Sumon suggested in #3117.

Refs #3117

How was this verified?

New test cache_size_limits_follow_listener_and_store: a 16 MiB listener limit advertises 15 MiB, and a store without a limit advertises 0. Unit tests cover the two conversions. capabilities_server_test (4) passes on current main locally (Windows, cargo), and the server crate type-checks. I haven't run the Bazel targets locally; CI covers them.

reference/protocol-api.mdx is updated for both fields.

Risk

Low. Clients batch more blobs per request, up to the limit the server already enforced. A client that honors max_cas_blob_size_bytes stops sending blobs the store would have rejected anyway.

AI assistance

Claude Code found this during a REAPI conformance audit, made the change, wrote the tests and ran them. I reviewed every line.

max_batch_total_size_bytes was a hard-coded 64 KiB, unrelated to the 4 MiB
gRPC decoding limit the listener enforces, which pushed most blobs onto
ByteStream. max_cas_blob_size_bytes (REAPI 2.12) was always 0, even when the
CAS store caps blob size. The batch limit now follows the listener's
max_decoding_message_size, less 1/16 for per-blob framing, and
max_cas_blob_size_bytes is the CAS store's max_upload_size(), or 0 (no
limit) when the store has none.

Refs TraceMachina#3117

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nativelink Ready Ready Preview Nov 21, 2026 12:35am UTC
nativelink-aidm Ready Ready Preview Nov 21, 2026 12:35am UTC

Request Review

This branch was successfully deployed

2 active deployments
Preview – nativelink — b1d03cff Deployed Nov 21, 2026 by vercel[bot]
Preview – nativelink-aidm — b1d03cff Deployed Nov 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant