fix: remove gzip middleware from agent endpoints#2627
Merged
Conversation
Contributor
|
Container images for this PR have been built successfully!
Built from commit 8c6a111 |
|
Thanks for the quick turnaround! One observation for the future, in case gzip If/when compression comes back, a companion test that enables gzip and asserts resp := http2Get(server, "/api/foo", "Accept-Encoding: gzip")
require.Equal(t,
atoi(resp.Header.Get("Content-Length")),
len(rawBody), // BEFORE decompression
"Content-Length must match wire bytes per RFC 9113 §8.1.1",
)Not a blocker for this PR — just noting it so the property is captured somewhere |
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.

Checklist
mainbranchWhat This PR Implements
Fixes: #2626
Fixes: #2625
Changes Made
Testing Done
./scripts/development/dev.sh startjust lint all)just test backendAI Tool Used (if applicable)
AI Tool:
Assistance Level:
What AI helped with:
I reviewed and edited all AI-generated output:
I ran all required tests and manually verified changes:
Additional Context
Disclaimer Greptiles Reviews use AI, make sure to check over its work.
To better help train Greptile on our codebase, if the comment is useful and valid Like the comment, if its not helpful or invalid Dislike
To have Greptile Re-Review the changes, mention
greptileai.Greptile Summary
This PR fixes gzip-related issues with agent/proxy endpoints by removing the Echo gzip middleware from the
/apiroute group entirely and suppressing theAccept-Encodingheader when the manager proxies requests to remote agents.router_bootstrap.go: Drops theechomiddleware.GzipWithConfigcall that applied level-5 compression to all/apiresponses. The previous skipper only excluded WebSocket/streaming paths; removing the middleware globally eliminates gzip interference on HTTP/2 and agent tunnels.remenv.go: AddsAccept-EncodingtoGetSkipHeaders()so the proxy never asks remote agents to compress their responses, preventing the manager from receiving opaque compressed payloads it cannot decode.TestHTTP2APIResponsesDoNotUseAPIGzipInternal) validates the fix end-to-end against a live server;remenv_test.goadds a corresponding assertion for the new skip entry.Confidence Score: 5/5
Safe to merge — the changes are minimal, well-scoped, and backed by a real H2C integration test.
Both changes are small and targeted: the gzip middleware removal is a single apiGroup.Use(...) deletion, and the Accept-Encoding skip is a one-line map entry addition. The new integration test exercises the actual fix against a real server, and the existing test suite gains a matching assertion. No logic paths, auth flows, or data models are touched.
No files require special attention.
Reviews (1): Last reviewed commit: "fix: remove gzip middleware from agent e..." | Re-trigger Greptile