mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-29 11:42:17 +00:00
chore: merge latest v2
This commit is contained in:
commit
7256808806
2 changed files with 7 additions and 7 deletions
|
|
@ -331,13 +331,13 @@ export const GithubCopilotPlugin = define({
|
|||
return
|
||||
}
|
||||
const id = evt.model.modelID ?? evt.model.id
|
||||
// Copilot serves Grok, Gemini, and MAI Code only on /responses; advertised
|
||||
// endpoint metadata above wins whenever the live model list provides it.
|
||||
// Copilot serves Grok and MAI Code only on /responses, and Gemini only on
|
||||
// /chat/completions; advertised endpoint metadata above wins whenever the
|
||||
// live model list provides it.
|
||||
const gpt = /^gpt-(\d+)/.exec(id)
|
||||
const responses =
|
||||
(gpt !== null && Number(gpt[1]) >= 5 && !id.startsWith("gpt-5-mini")) ||
|
||||
id.startsWith("grok-") ||
|
||||
id.startsWith("gemini-") ||
|
||||
id.startsWith("mai-code-")
|
||||
evt.language = responses ? evt.sdk.responses(id) : evt.sdk.chat(id)
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -487,7 +487,7 @@ describe("GithubCopilotPlugin", () => {
|
|||
}),
|
||||
)
|
||||
|
||||
it.effect("uses responses for Grok, Gemini, and MAI Code models", () =>
|
||||
it.effect("uses responses for Grok and MAI Code models and chat for Gemini", () =>
|
||||
Effect.gen(function* () {
|
||||
const aisdk = yield* AISDK.Service
|
||||
const calls: string[] = []
|
||||
|
|
@ -512,8 +512,8 @@ describe("GithubCopilotPlugin", () => {
|
|||
})
|
||||
yield* aisdk.runLanguage({
|
||||
model: Model.Info.make({
|
||||
...Model.Info.default(Provider.ID.make("github-copilot"), Model.ID.make("gemini-3.5-flash")),
|
||||
modelID: Model.ID.make("gemini-3.5-flash"),
|
||||
...Model.Info.default(Provider.ID.make("github-copilot"), Model.ID.make("gemini-3.8-flash")),
|
||||
modelID: Model.ID.make("gemini-3.8-flash"),
|
||||
package: "aisdk:test-provider",
|
||||
}),
|
||||
sdk: fakeSelectorSdk(calls),
|
||||
|
|
@ -540,7 +540,7 @@ describe("GithubCopilotPlugin", () => {
|
|||
expect(calls).toEqual([
|
||||
"responses:grok-4.5",
|
||||
"responses:grok-4.6",
|
||||
"responses:gemini-3.5-flash",
|
||||
"chat:gemini-3.8-flash",
|
||||
"responses:mai-code-1.1-flash",
|
||||
"chat:gpt-4o",
|
||||
])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue