Skip to content

Reuse upstream HTTP connections for Responses - #27

Merged
reonokiy merged 1 commit into
mainfrom
fix/gateway-ttft-ttfb
Nov 21, 2026
Merged

reonokiy merged 1 commit into
mainfrom
fix/gateway-ttft-ttfb

Conversation

@reonokiy

Copy link
Copy Markdown
Owner

Changes

  • Share Codex HTTP transport across Responses and model discovery and enable TCP_NODELAY for accepted connections.
  • Distinguish SSE and buffered Responses in HTTP latency telemetry.
  • Verify that two inference requests reuse the model discovery connection and return SSE headers while upstream events are gated.

Validation

  • Local workspace tests on Rust 1.100.0 passed (343 passed, 12 ignored).
  • Formatting and workspace Clippy passed.
  • A local control using the previous transport opened three upstream TCP connections. The patched version opened one.

Why
Individual Responses calls rebuilt the upstream client and its connection pool. Buffered and streaming responses also shared the same ingress latency dimension.

How
Share Codex transport across Responses and model discovery, enable TCP_NODELAY for accepted sockets, and label response mode in ingress telemetry. Verify reuse and early SSE headers against a local upstream.
@reonokiy
reonokiy merged commit 148419a into main Nov 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant