fix(epp): read every gRPC frame in a vllmgrpc response chunk #4189
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.44) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.44 · 243 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.329
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #4189"
general
weight: 0.35
ahg-g
What type of PR is this?
/kind bug
What this PR does / why we need it:
The vllmgrpc response parser decoded only the first length-prefixed gRPC frame of each response body chunk and ignored the rest. The handler's
completeGRPCFramesalready hands the parser whole frames and carries a split frame to the next chunk, but one chunk can still hold several frames. When aGenerateCompleteshares a chunk with the precedingGenerateStreamChunk, its usage was dropped and the request was recorded with no token counts.ParseResponsenow walks every frame withgrpcframe.ForEachPayload, the same iterator the sglanggrpc parser uses. Per-frame decoding (GenerateResponse, falling back to EmbedResponse) is unchanged and moved intoparseResponsePayload. When several frames carry usage, the last one wins, matching the vertexai parser. A frame that cannot be decoded is reported in the returned error, and the usage of the other frames in the chunk is still returned. The single-frametoGenerateResponseandtoEmbedResponsehelpers are removed since they have no other callers.The empty end-of-stream body handling from #3652 is unchanged.
Which issue(s) this PR fixes:
Fixes #3644
Test plan:
GenerateCompletereports the complete frame's usage (fails on main with no usage).go test ./pkg/epp/framework/plugins/requesthandling/... ./pkg/epp/handlers/...passes;golangci-lint runon the package reports 0 issues.Release note _(write
NONEif no user-facing change)_:``
release-note
``Fixed the vLLM gRPC response parser dropping token usage when several gRPC frames arrive in one response body chunk.