commit 2eec278 ↗ · envoyproxy/envoy · · committed Jun 27, 2026 · +440−34 · base 6f85cc5c6b78
Agent prompt
what a new run launched now would send
Envoy hard-codes the upstream (client) HTTP codec inside CodecClientProd by protocol. Some workloads (notably reverse tunnels, where the dialed peer is the HTTP/2 client) need a per-cluster way to supply a custom or decorated upstream client codec so drain/GOAWAY behavior can cooperate across the tunnel. Today there is no cluster-scoped hook for that substitution.
Add an optional, opt-in per-cluster extension point for building the upstream HTTP client codec:
- Attach via existing typed_extension_protocol_options / ProtocolOptionsConfig machinery; surface it on cluster info with a default of “none” so existing clusters are unaffected.
- When a factory is present, CodecClientProd must consult it and install the returned codec. Returning null must mean “use the stock codec for this connection.” With no factory configured, behavior must match today’s stock path exactly.
- Do not construct the stock codec when a custom codec will be used: stock construction has immediate connection side effects (e.g. HTTP/2 SETTINGS), so building-then-discarding would corrupt the connection. Custom codecs that fully replace construction (including HTTP/3 session init on the stock path) own that responsibility; returning null for unsupported types may defer to stock.
- At most one such factory may be configured on a cluster; multiple must fail cluster setup with a clear error.
- Lifetime: the factory view exposed from the cluster must remain valid for the life of the options object that owns it.
No user-facing xDS/proto changes and no behavior change when the extension is unset.
Interface contract — the change must expose exactly this surface:
Http::ClientCodecFactory in envoy/http/client_codec_factory.h with nested Context {CodecType type; Network::Connection& connection; ConnectionCallbacks& callbacks; const Upstream::ClusterInfo& cluster; Random::RandomGenerator& random; const std::shared_ptr<const Network::TransportSocketOptions>& options} and virtual ClientConnectionPtr createClientCodec(const Context&) const (nullptr => stock). ProtocolOptionsConfig::upstreamHttpClientCodecFactory() and ClusterInfo::upstreamHttpClientCodecFactory() return OptRef<const Http::ClientCodecFactory>, default empty/non-pure. Multiple factories on one cluster must reject with: "multiple upstream HTTP client codec factories configured on a single cluster via typed_extension_protocol_options; at most one is allowed".
Work only inside this repository checkout. Make the code change the task
describes, keeping the diff focused — no drive-by refactors.
When you are done, leave your changes committed or in the working tree;
they are collected automatically.
Stay on this snapshot checkout (`task/ycb_envoy_c2eec278ae3aa`). Never checkout, pull, or rebase onto `main`. That branch is a README-only orphan.
Stay on this HEAD. Do not fetch another default branch. Push only on the Cursor-created `crazy-cursor/…` side branch from this HEAD.
Some past runs of this task were launched with a different prompt (the prompt template changed since, or those runs predate this benchmark's stored prompt). Each run persists the exact prompt it sent at launch — that per-launch record is the audit trail; this page shows only the current one.
Reference diff
The task commit's diff against its first parent — the judge's comparison target.