Reuse warmed TLS on MCP HTTP and WSS reconnects - #679
Closed
justrach wants to merge 4 commits into
Closed
Conversation
The modern tools/list probe and legacy initialized notify each built a throwaway HTTP client, so a successful probe's keep-alive died before the next call. WSS rescanned the host CA store on every dial. Probe and initialized now use the persistent transport; WSS shares a process-lifetime CA bundle warmed once. WS→SSE stays on the prewarmed Agent pool. Loopback test: connect + next list is one TCP accept.
embedFile includes the test body, so a contiguous throwaway-client string in the assertion always "found" itself. Split the needles.
justrach
marked this pull request as ready for review
August 29, 2026 18:18
Streamable HTTP omitted Accept-Encoding and read the raw body, so a tools/list catalog crossed uncompressed. Provider POST already decompresses. Advertise the std client defaults and decode Content-Encoding. Loopback: a 40-tool list is smaller on the wire than plaintext, and the client still returns the JSON. ADR 0043 updated.
A second launch CA walk is 4–7ms and OAuth throwaways are login-only; ADR 0002 blocks shrinking WS bodies. No further code change. Table is the evidence for stopping.
Owner
Author
|
Folded into release/v0.0.282 (#696). ADR remapped 0043 → 0050 (0043 is Pi SWE). Closing as superseded. |
cursor Bot
pushed a commit
that referenced
this pull request
Aug 31, 2026
Complementary to #694 model-HTTP generations: MCP HTTP/WSS keep the warmed client and accept gzip catalogs. ADR remapped off 0043. # Conflicts: # docs/adr/README.md # src/http_warm.zig # src/test_hooks.zig
cursor Bot
pushed a commit
that referenced
this pull request
Aug 31, 2026
Record the ADR remaps (0049 / 0050) and the extra #694 lifecycle hardening. Still no tag.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The harness was paying extra TLS and sending MCP catalogs uncompressed. Further speedups after this PR do not pay for themselves (see table).
Round-trips / reconnects
tools/listprobe and legacynotifications/initializedeach built a throwawaystd.http.Client.Payload
Accept-Encoding. It now advertises gzip/deflate and decodesContent-Encoding.Left alone
Prompt-cache keys, xAI WS full-resend (ADR 0002), MCP consent, deferred MCP join, OAuth login clients.
Measured (this host, 2026-08-30)
tools/listrescanper connecttools/list(40-tool fixture)Suite: 1760 (+7 reachable tests vs this main). Baseline 1745 unchanged. Tier 1 green on
4589a70. ADR 0043; 0042 is reserved by the sandbox teleport PR.