Repository navigation
[AI-4057] Say plainly what each streamed-answer limit is for - #2627
Conversation
The comments added with the streamed-answer limits were hard to follow on a cold read. This rewrites nine of them. No code changes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
kanat
left a comment
There was a problem hiding this comment.
Verdict: NO-GO. The nine rewrites are applied word for word, and eight of them are true to the code beside them. The one on maxStreamBytes gives a wrong example.
T1.1 (prior, comments): open. Eight comments check out. The maxStreamBytes comment needs the change in the inline comment.
D1 (new, inline): one wrong example. The maxStreamBytes comment says the body limit stops an event whose data lines never end. eventLimit stops that event at maxEventBytes, long before the body limit is reached. The body limit stops blank lines and data-less events that Advance never sees.
Checks
git diff c55ad4210 985af0181: 32 lines changed inopenaicompat.go, all comments.gofmt -l: clean.go build ./...andgo vet ./internal/llm/openaicompat/: pass.go test ./internal/llm/openaicompat/: pass.- Head is unchanged at
985af0181.
…ess event The comment said the body limit stops one event whose data lines never end. eventLimit cuts that event at maxEventBytes, well before the body limit. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
kanat
left a comment
There was a problem hiding this comment.
VERDICT: GO
Delta review of the D1 fix at 2894a1f (was 985af01). The change is one comment in acceleration/internal/llm/openaicompat/openaicompat.go, and nothing else in the diff.
- The new last sentence matches the code. The body cap is set in
sniff(thehttp.MaxBytesReadercall withmaxStreamBytes), andeventLimitcuts an event that runs on without a blank line well before that cap. eventLimitresets its counters at each blank line, so a stream of blank lines reaches only the body cap. The comment says so.- The comment is the replacement text suggested in the review thread, word for word. Build, vet and gofmt pass. The package tests pass on the new head.
- Comment-only change, so no mutation applies. The claims were checked by reading the code.
D1 is fixed, and its thread is resolved. No new findings.
Why
The code comments that #2597 added for the streamed-answer limits were hard to follow when read cold. This PR rewrites nine of them in plain sentences. No code changes.
Changes
maxAnswerBytesmaxStreamByteschunkBytesmaxEventBytesmaxEventValuescallByteseventLimithttp.MaxBytesReadereventLimit.ReadAdvanceValidation
The diff only touches comments in
acceleration/internal/llm/openaicompat/openaicompat.go. The build,go vetand the package tests pass.Commands
The wording of each comment comes from the text review of #2597.
🤖 Generated with Claude Code