A code review failed. Not because the patch was wrong, and not because the
reviewer disagreed with it. The provider refused the call: the prompt was too
large. The reviewer never saw the code.
When we reconstructed that request from retained release bytes, it was
2,173,772 bytes. Of those, 1,532,026 were mandatory: the exact scoped patch and
the test result. The rest was optional context we had added to help — call
sites of the changed functions and the definitions of names the patch imports.
That distinction mattered less than we expected. Removing every optional byte
still left 1.5 MB of mandatory evidence, and the provider's limit is measured
in tokens, with system and tool instructions counting too. A second
reconstruction at a 2 MB target landed at 1,978,003 bytes — an estimated
961,000 tokens on top of roughly 412,000 tokens of fixed overhead. About
39,000 tokens of headroom. A prompt that size is not comfortably under a limit;
it is one small change away from failing again.
Measure the whole request, not the interesting part
The gate now builds one complete request, serializes it, and measures the
bytes that would actually go over the wire. That is a different number from the
size of the patch, or the size of the context, or the sum of the two: JSON
encoding, keys and quoting all cost bytes too.
If the request is too large, the gate drops optional context from the
lowest-priority end first. Call sites of changed definitions are the cheapest
evidence a reviewer needs, so they are kept; imported definitions are dropped
before them. Every dropped excerpt is named in the request, and the request
explicitly says its context is incomplete. A smaller prompt cannot quietly
claim it showed the reviewer everything.
If the request is still too large after all optional context is gone, the gate
refuses before spending a model call. The evidence is too big for the reviewer
to judge; the honest answer is to split the release, not to send a partial
request and hope.
What the ceiling buys
We set the transport ceiling at 1,750,000 bytes. Re-running the same
reconstruction under it gives 1,720,664 bytes, by our estimate about 889,000
tokens. All five call-site excerpts survive. 114 optional imported definitions
are named as omitted. The reviewer is told exactly what it did not get.
The number is a ceiling, not a target. It leaves room for the fixed overhead
that does not show up in the patch and for the difference between an estimated
token count and the provider's real one. Close to the limit, that difference is
the whole experiment.
We also moved the decode of the reviewer's reply into one named place. Malformed
bytes now raise instead of turning into a default verdict, and the response
parsing stays inside the boundary the parsing check already measures.
229 tests and the parsing guard pass with the change. None of them claims the
provider now accepts a 1.7 MB prompt. What they pin is the behavior we control:
measure the complete request, drop named evidence first, refuse when the
mandatory part alone does not fit, and fail loudly on an unreadable answer.
The habit
A model call is a bounded resource with a failure mode that looks nothing like
a code defect. If a gate can spend that call, it should know the size of what it
is about to spend before spending it — and it should say which evidence it had
to leave behind. "The review failed" is a poor description of "the review never
started because the request was 2.1 MB". Those are different events, and only
one of them tells you what to fix.
