fix(auth): routed copilot business endpoint
Stored GitHub Copilot plan-specific API endpoints discovered during OAuth login and propagated them through structured credentials, model discovery, usage/probe metadata, and request base URL resolution. Added regression coverage for Business endpoint discovery, serialization, dynamic model discovery, and chat/responses routing. Fixes #2876
This commit is contained in:
@@ -81,6 +81,20 @@ describe("github copilot model limits mapping", () => {
|
||||
expect(fetchMock).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("unwraps structured OAuth keys for discovery and routes business discovery to the business host", async () => {
|
||||
const structuredApiKey = JSON.stringify({
|
||||
token: "ghu_test_copilot_token",
|
||||
apiEndpoint: "https://api.business.githubcopilot.com",
|
||||
});
|
||||
const { fetchMock } = await discoverCopilotModels(
|
||||
{ data: [] },
|
||||
structuredApiKey,
|
||||
"https://api.business.githubcopilot.com",
|
||||
"ghu_test_copilot_token",
|
||||
);
|
||||
expect(fetchMock).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("uses max_context_window_tokens as context window when Copilot reports a prompt budget", async () => {
|
||||
const { models, fetchMock } = await discoverCopilotModels({
|
||||
data: [
|
||||
|
||||
Reference in New Issue
Block a user