Skip to content

fix: stop sending the gateway metadata request header - #50

Merged
steve-calvert-glean merged 1 commit into
mainfrom
fix/drop-gateway-metadata-header
Nov 19, 2026
Merged

steve-calvert-glean merged 1 commit into
mainfrom
fix/drop-gateway-metadata-header

Conversation

@steve-calvert-glean

Copy link
Copy Markdown
Contributor

Problem

The plugin's local server sends X-Glean-Gateway-Request-Metadata on every request to Glean. Glean reads that header only on requests from its own services. The plugin stopped identifying as one in 3.6.0, so the header has had no effect since then.

It is also an internal header. Glean's edge can reject a request from outside that carries one. #41 removed the other internal headers for the same reason.

Change

  • Remove the header from the transport.
  • Remove buildGatewayMetadataHeader and its hand-written encoder.
  • Remove the chatSessionId parameter of createRemoteClient. It existed only to fill the header.
  • The header test now asserts that no request header starts with X-Glean-. Before, it asserted that this header was present.

No behavior changes for users. This applies to Claude Code, Cursor, and Codex, because all three use the same local server.

Verification

  • The new header assertion fails on main: expected [ 'x-glean-gateway-request-metadata' ] to deeply equal []. It passes with this change.
  • npm run typecheck:bundle passes.
  • npm run test:bundle passes: 24 files, 430 tests.
  • npm test builds and validates the claude, cursor, and codex outputs.
  • No built bundle under dist/ contains the string x-glean-.

Not verified: a live request to a Glean deployment with the built plugin.

The plugin's local server sent X-Glean-Gateway-Request-Metadata on every
request to Glean. Glean reads that header only on requests from its own
services, and the plugin stopped identifying as one in 3.6.0, so the header
has had no effect since then. It is also an internal header, which Glean's
edge can reject on a request from outside.

Remove the header, the hand-written encoder that built it, and the
chatSessionId parameter that existed only to fill it. The header test now
asserts that no request header starts with X-Glean-.
@steve-calvert-glean
steve-calvert-glean marked this pull request as ready for review November 19, 2026 03:27
@steve-calvert-glean
steve-calvert-glean requested a review from a team as a code owner November 19, 2026 03:27
@steve-calvert-glean
steve-calvert-glean merged commit 4a4daa2 into main Nov 19, 2026
1 check passed
@steve-calvert-glean
steve-calvert-glean deleted the fix/drop-gateway-metadata-header branch November 19, 2026 03:39
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