perf(epp): skip the request-body echo when the body is unchanged #4193
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 235 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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
Diff Size
diff_size
0.327
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #4193"
general
weight: 0.35
blacksoxx
What type of PR is this?
/kind performance
/kind feature
What this PR does / why we need it:
The EPP always returns the full request body to the proxy after scheduling, even when nothing was rewritten. For a large body that is a lot of extra gRPC chunks and a full extra copy. Most requests do not trigger a model rewrite or other payload change.
This adds
--skip-unmodified-request-body(off by default). When it is set andInferenceRequestBody.Mutatedis false, the request-body ext_proc response still goes back (ext_proc requires one) but without abody_mutation, so the proxy keeps the bytes it already holds. A rewritten body is forwarded as before.The skip only applies when Envoy reports
request_body_modeBUFFEREDorBUFFERED_PARTIALin the stream'sprotocol_config. The default charts useFULL_DUPLEX_STREAMED, and in that mode the proxy does not retain the original body, so there (and when Envoy does not sendprotocol_config) the body is still echoed and the flag is a no-op.Which issue(s) this PR fixes:
Fixes #3859
Release note _(write
NONEif no user-facing change)_:``
release-note
``Add the opt-in EPP flag --skip-unmodified-request-body, which omits body_mutation on the request-body ext_proc response when the body was not rewritten. It applies only when Envoy reports BUFFERED or BUFFERED_PARTIAL request_body_mode.
Test plan: