From b77077f4d188642945f033c8660e8d8672ec598a Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 17 May 2026 05:14:12 +0100 Subject: [PATCH] fix(github-copilot): request identity-encoded API responses --- CHANGELOG.md | 1 + extensions/github-copilot/embeddings.test.ts | 1 + extensions/github-copilot/models.test.ts | 7 +++++++ extensions/github-copilot/stream.test.ts | 1 + src/plugin-sdk/provider-auth.ts | 1 + 5 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d48657457a..17ec7c6005b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Docs: https://docs.openclaw.ai ### Fixes +- Providers/GitHub Copilot: request identity-encoded Copilot API responses across token exchange, catalog, model calls, usage, and embeddings so compressed Business-account error payloads no longer reach JSON parsers as gzip bytes. Fixes #82871. Thanks @tonyfe01. - Agents/diagnostics: split slow embedded-run `attempt-dispatch` startup summaries into workspace, prompt, runtime-plan, and final dispatch subspans so traces identify the delayed setup phase. Fixes #82782. (#82783) Thanks @galiniliev. - CLI/media: accept HTTP(S) URLs in `openclaw infer image describe --file`, fetching remote images through the guarded media path instead of treating URLs as local files. Fixes #82837. (#82854) Thanks @neeravmakwana. - Agents/subagents: keep session-backed parent runs active when the child wait call times out before the child session has actually settled, so late subagent completions are reconciled instead of being lost. Fixes #82787. Thanks @ramitrkar-hash. diff --git a/extensions/github-copilot/embeddings.test.ts b/extensions/github-copilot/embeddings.test.ts index f3f0ac35a68..6c62981545d 100644 --- a/extensions/github-copilot/embeddings.test.ts +++ b/extensions/github-copilot/embeddings.test.ts @@ -244,6 +244,7 @@ describe("githubCopilotMemoryEmbeddingProviderAdapter", () => { const discoveryCall = firstDiscoveryRequest(); expect(discoveryCall.url).toBe("https://proxy.example/v1/models"); + expect(discoveryCall.init.headers["Accept-Encoding"]).toBe("identity"); expect(discoveryCall.init.headers["X-Proxy-Token"]).toBe("proxy"); }); diff --git a/extensions/github-copilot/models.test.ts b/extensions/github-copilot/models.test.ts index f4c47d167eb..93edc1a6a3f 100644 --- a/extensions/github-copilot/models.test.ts +++ b/extensions/github-copilot/models.test.ts @@ -412,6 +412,10 @@ describe("github-copilot token", () => { expect(res.token).toBe("fresh;proxy-ep=https://proxy.contoso.test;"); expect(res.baseUrl).toBe("https://api.contoso.test"); + const [, calledInit] = fetchImpl.mock.calls[0] ?? []; + expect(((calledInit as RequestInit).headers as Record)["Accept-Encoding"]).toBe( + "identity", + ); expect(jsonStoreMocks.saveJsonFile).toHaveBeenCalledTimes(1); }); }); @@ -537,6 +541,9 @@ describe("fetchCopilotModelCatalog", () => { expect(((calledInit as RequestInit).headers as Record).Authorization).toBe( "Bearer tid=test", ); + expect(((calledInit as RequestInit).headers as Record)["Accept-Encoding"]).toBe( + "identity", + ); expect(out.map((m) => m.id)).toEqual([ "gpt-5.5", diff --git a/extensions/github-copilot/stream.test.ts b/extensions/github-copilot/stream.test.ts index 2d0b6537b92..abfe148c69a 100644 --- a/extensions/github-copilot/stream.test.ts +++ b/extensions/github-copilot/stream.test.ts @@ -64,6 +64,7 @@ describe("wrapCopilotAnthropicStream", () => { messages, hasImages: true, }); + expect(expectedCopilotHeaders["Accept-Encoding"]).toBe("identity"); void wrapped( { diff --git a/src/plugin-sdk/provider-auth.ts b/src/plugin-sdk/provider-auth.ts index 3aa4c0272f3..dc2c39d9d84 100644 --- a/src/plugin-sdk/provider-auth.ts +++ b/src/plugin-sdk/provider-auth.ts @@ -122,6 +122,7 @@ export function buildCopilotIdeHeaders( } = {}, ): Record { return { + "Accept-Encoding": "identity", "Editor-Version": COPILOT_EDITOR_VERSION, "Editor-Plugin-Version": COPILOT_EDITOR_PLUGIN_VERSION, "User-Agent": COPILOT_USER_AGENT,