← Back to Pull requests

perf(epp): skip the request-body echo when the body is unchanged #4193

Closed
unknown closed this pull request without merging on Nov 20, 2026 10:58 UTC
View on GitHub
unknown unknown commented on Nov 11, 2026 17:59 UTC
Author

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 and InferenceRequestBody.Mutated is false, the request-body ext_proc response still goes back (ext_proc requires one) but without a body_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_mode BUFFERED or BUFFERED_PARTIAL in the stream's protocol_config. The default charts use FULL_DUPLEX_STREAMED, and in that mode the proxy does not retain the original body, so there (and when Envoy does not send protocol_config) the body is still echoed and the flag is a no-op.

Which issue(s) this PR fixes:
Fixes #3859

Release note _(write NONE if 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:

  • An unmodified body under the flag is answered with a request-body response that has no body_mutation

  • A rewritten body under the flag is still forwarded

  • With the flag off, an unmodified body is still echoed (default)

  • Trailers are still sent after a skipped mutation

  • Under the flag, FULL_DUPLEX_STREAMED or a missing protocol_config still echoes the body; BUFFERED_PARTIAL skips

  • The flag is off by default and is mapped through ExtProcServerRunner
  • Diff: 235 lines (+176 / -59) across 2 files Reviewer: blacksoxx Review duration: 12539m
    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
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 37.1% (MEDIUM) · Higher = larger blast radius
    37.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 14.7% · Safe to merge
    14.7%