feat(proxy): opt-in stream aggregation behind aggregate: true #12
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/aggregate"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A non-streaming completion sends no bytes -- headers included -- until
the last token is generated, so on a slow model the whole generation
happens inside the route's response-header timeout. Sized for the
worst-case generation, that timeout no longer detects a hung backend;
sized as a liveness check, it kills legitimate requests.
aggregate: true on a route converts the client's non-streaming
completion into an upstream streaming request and reassembles the SSE
chunks into the plain JSON response the client asked for. Upstream
headers arrive at time-to-first-token, so the timeout is a liveness
check again and generation may take as long as it takes.
This is SLP's one deliberate exception to never touching response
bytes, which is why it is opt-in per route and handled conservatively
at the edges: clients that asked to stream pass through untouched, as
do logprobs-family requests (gllm rejects logprobs with streaming) and
non-SSE upstream responses. In-band stream error events come back as a
real 502 with the upstream's error object -- something a pass-through
stream cannot offer -- and a stream that dies before [DONE] is a 502,
never a silently truncated 200.
Editions declare the flag themselves, never inheriting it from the
backend: an edition's upstream is a different program with its own
streaming behavior.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Automated review by pr-reviewer v0.37.0 | Safety Check | Claude Sonnet 5 | tracking id
r-6158f5-e1a3ffThis is an AI-generated review and may contain mistakes.
Status: ✅ Completed
✅ Verdict: LGTM — The "secret" flagged by automation is just fake test request-ID strings, and the aggregation logic is well-guarded and tested with no signs of committed credentials or breaking changes.
Reviewed the diff carefully.
aggregate.gois a false positive — it's just thegdqz1/gdqz000000000000000000000000style fake request-ID strings used in tests/comments (mirroring gllm's real ID prefix), not real credentials or tokens. No actual secrets, keys, or connection strings are present anywhere in the diff.[DONE]) — all covered with corresponding tests (aggregate_test.go,config_test.go).Aggregateflag is explicitly not inherited from backend, matching stated intent, and is tested (TestCompileCarriesAggregate).maxAggregateBytescap bounds memory growth from a misbehaving upstream stream.Nothing here looks like it shouldn't have been pushed.
8f40366ba1a3c97a2a68