mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-07 07:11:06 +00:00
fix(github-copilot): send IDE auth headers on runtime requests (#60755)
* Fix Copilot IDE auth headers * fix(github-copilot): align tests and changelog * fix(changelog): scope copilot replacement entry --------- Co-authored-by: VACInc <3279061+VACInc@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { buildCopilotDynamicHeaders } from "openclaw/plugin-sdk/provider-stream";
|
||||
import { wrapCopilotAnthropicStream } from "./stream.js";
|
||||
|
||||
describe("wrapCopilotAnthropicStream", () => {
|
||||
@@ -33,6 +34,10 @@ describe("wrapCopilotAnthropicStream", () => {
|
||||
},
|
||||
],
|
||||
} as never;
|
||||
const expectedCopilotHeaders = buildCopilotDynamicHeaders({
|
||||
messages: context.messages as Parameters<typeof buildCopilotDynamicHeaders>[0]["messages"],
|
||||
hasImages: true,
|
||||
});
|
||||
|
||||
wrapped(
|
||||
{
|
||||
@@ -49,9 +54,7 @@ describe("wrapCopilotAnthropicStream", () => {
|
||||
expect(baseStreamFn).toHaveBeenCalledOnce();
|
||||
expect(baseStreamFn.mock.calls[0]?.[2]).toMatchObject({
|
||||
headers: {
|
||||
"X-Initiator": "user",
|
||||
"Openai-Intent": "conversation-edits",
|
||||
"Copilot-Vision-Request": "true",
|
||||
...expectedCopilotHeaders,
|
||||
"X-Test": "1",
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user