fix(core): discover Copilot API endpoint (#38184)
This commit is contained in:
parent
da35eac93f
commit
a0a6963beb
2 changed files with 57 additions and 13 deletions
|
|
@ -1,12 +1,12 @@
|
|||
import { AISDK } from "@opencode-ai/core/aisdk"
|
||||
import { App } from "@opencode-ai/core/app"
|
||||
import { describe, expect } from "bun:test"
|
||||
import { describe, expect, test } from "bun:test"
|
||||
import { Effect } from "effect"
|
||||
import { Catalog } from "@opencode-ai/core/catalog"
|
||||
import { ModelV2 } from "@opencode-ai/core/model"
|
||||
import { PluginV2 } from "@opencode-ai/core/plugin"
|
||||
import { PluginHost } from "@opencode-ai/core/plugin/host"
|
||||
import { copilotFetch, GithubCopilotPlugin } from "@opencode-ai/core/plugin/provider/github-copilot"
|
||||
import { copilotBaseURL, copilotFetch, GithubCopilotPlugin } from "@opencode-ai/core/plugin/provider/github-copilot"
|
||||
import { ProviderV2 } from "@opencode-ai/core/provider"
|
||||
import { Integration } from "@opencode-ai/core/integration"
|
||||
import type { LanguageModelV3 } from "@ai-sdk/provider"
|
||||
|
|
@ -41,6 +41,15 @@ function fakeSelectorSdk(calls: string[]) {
|
|||
}
|
||||
|
||||
describe("GithubCopilotPlugin", () => {
|
||||
test("prefers the account-specific Copilot API endpoint", () => {
|
||||
expect(
|
||||
copilotBaseURL({
|
||||
enterpriseUrl: "company.ghe.com",
|
||||
apiEndpoint: "https://api.business.githubcopilot.com",
|
||||
}),
|
||||
).toBe("https://api.business.githubcopilot.com")
|
||||
})
|
||||
|
||||
it.effect("registers GitHub Copilot device OAuth", () =>
|
||||
Effect.gen(function* () {
|
||||
yield* addPlugin()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue