Skip to content

Parity tests: Cap divergence for request and response bodies #987

Closed

Description

@evaline-ju

The inbound-request-overflow fixture (#937) covers extproc + reverseproxy at their shared 1 MiB cap. Two adjacent caps have no coverage today, and each is a real divergence between deployment shapes:

Direction extproc reverseproxy forwardproxy
Request body 1 MiB 1 MiB 10 MiB
Response body 1 MiB 1 MiB 10 MiB

Why it matters

A body between 1 MiB and 10 MiB (agent egress with concatenated history + tool manifest, LLM streaming response) is accepted on the laptop path (forwardproxy) and rejected on the Kubernetes envoy-sidecar path (extproc). The two caps have grown independently in authbridge/authlib/listener/{extproc,forwardproxy}/server.go — nothing forces the operator-visible contract to be either "same cap" or "documented gap."

Anthropic Claude Code sessions produce 5 MiB request bodies (measured in PR #904); response bodies follow suit.

Fix

Two fixtures, one shape:

  1. Outbound request-body overflow — body between 1 MiB and 10 MiB, direction: pipeline.Outbound. Forwardproxy accepts (pipeline runs, wire status 200); extproc rejects (pipeline refused pre-run, wire status 413).
  2. Response-body overflow — upstream serves a body between 1 MiB and 10 MiB. Same asymmetric outcome: forwardproxy accepts, extproc + reverseproxy reject with 502.

Both are asymmetric-per-listener — not a naive assertParity call. Options:

  • Add an expectPerListener map[string]expectedBehavior field to the fixture, or
  • Use per-listener sub-tests rather than the shared harness.

Follow-up from #937.

Activity

  1. changed the title [-]Parity tests: cap divergence for request and response bodies[/-] [+]Parity tests: Cap divergence for request and response bodies[/+] on Sep 14, 2026
  2. cwiklik commented on Oct 7, 2026

    @cwiklik
    Collaborator

    One correction to the table, found while building the body-mutation fixture (#938): the forwardproxy request cap is 32 MiB, not 10 MiB. The two directions use two different constants there, and only the response one is 10 MiB:

    • maxRequestBodySize = 32 << 20 — core/listener/forwardproxy/server.go:59, applied at :380 via http.MaxBytesReader
    • maxBodySize = 10 << 20 — core/listener/forwardproxy/server.go:79, applied to the response at :1185

    Both proxies' request caps are enforced in different places and the reverseproxy has only the one constant (maxBodySize = 1 << 20, reverseproxy/server.go:47) covering both directions, which is why the asymmetry is easy to miss. Corrected table:

    Direction extproc reverseproxy forwardproxy
    Request body 1 MiB 1 MiB 32 MiB
    Response body 1 MiB 1 MiB 10 MiB

    This makes the issue's case stronger rather than weaker: the undocumented request-body gap between deployment shapes is 1 MiB → 32 MiB, 3× wider than the table claims. The proposed fixture body ("between 1 MiB and 10 MiB") still works unchanged, since 10 MiB is under the real cap — but a fixture sized from the table would silently stop testing near the boundary, and anyone reading this issue to decide whether the caps should be unified would be reasoning from the wrong number.

    Worth noting for whoever picks this up: #938 added an opt-in expectedUpstream to the parity harness, which pins what each listener actually forwarded rather than only what it recorded. It does not solve the asymmetric-expectation problem this issue raises — assertParity still requires every listener in the set to agree — but it is a precedent for the "absolute per-listener expectation" shape, which is the direction the first of the two proposed options points.

    Assisted-By: Claude (Anthropic AI) <[email protected]>

  3. added a commit that references this issue on Oct 13, 2026
    2fba5b0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions