Repository navigation
feat(prime-traces): raise the client line limit to 1 GiB - #1138
Merged
Merged
Conversation
The SDK rejects any line over MAX_LINE_BYTES before making a request, so episodes above 64 MiB never reach the service. Match the service's new limits: 1 GiB per line and 1100 MiB per request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kcoopermiller
requested review from
DamianB-BitFlipper,
JannikSt,
JohannesHa,
akirillo,
burnpiro,
cabrinha,
eexwhyzee,
kennethnym,
mrmoxon and
willccbb
as code owners
November 2, 2026 19:47
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
kennethnym
approved these changes
Nov 2, 2026
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.
Summary
Raises the SDK's trace upload limits to match the service: 1 GiB per JSONL line (was 64 MiB) and 1100 MiB per request (was 256 MiB).
The SDK rejects an oversized line locally with
TraceTooLargeError, before any request. So until this ships, episodes over 64 MiB can't be uploaded through the SDK,prime traces upload, orprime-runs, whatever the service allows.prime-runslogs the rejection as a warning and drops that batch.MAX_LINE_BYTESis now 1 GiB andMAX_BATCH_BYTESis 1100 MiB.DEFAULT_TARGET_BATCH_BYTESstays at 30 MiB, because an oversized line already gets its own batch. Its comment no longer cites a Cloud Run request cap, which doesn't fit single lines this large.Before you merge
trace_too_largeinstead of the local error.prime-tracesrelease and a dependency bump to pick this up.Testing
packages/prime-tracestests pass (185), including new ones that pin the limits and upload a line just over the old 64 MiB limit through default batching.Known costs at 1 GiB
DEFAULT_TIMEOUTstill allows 120s to wait for a response. A timeout retries safely under the same idempotency key, but each attempt compresses and sends the whole request again.🤖 Generated with Claude Code
Note
Medium Risk
Changes the core upload path and enables multi‑GiB in-memory batching/compression; clients deployed before the service raises limits will see server 400s instead of local errors.
Overview
Aligns prime-traces client-side rejection and batching caps with the service:
MAX_LINE_BYTESgoes from 64 MiB to 1 GiB, andMAX_BATCH_BYTESfrom 256 MiB to 1100 MiB. Oversized lines still fail locally withTraceTooLargeErrorbefore any HTTP call; with the old SDK cap, episodes between 64 MiB and 1 GiB could not be uploaded even when the server allowed them.DEFAULT_TARGET_BATCH_BYTESremains 30 MiB; its comment is rewritten to emphasize retry/memory cost instead of a Cloud Run request ceiling. Sync/asyncstream_bytesdocstrings and the HTTP clientDEFAULT_TIMEOUTcomment now describe 1 GiB / 1100 MiB payloads. Theprime traces get --rawCLI comment is updated similarly.Tests assert the new default constants and that a line just over the former 64 MiB limit batches successfully under default settings.
Reviewed by Cursor Bugbot for commit 2326bfc. Bugbot is set up for automated code reviews on this repo. Configure here.