Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/opencode/src/provider/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -895,8 +895,13 @@ export namespace ProviderTransform {
}
*/

// Convert integer enums to string enums for Google/Gemini
if (model.providerID === "google" || model.api.id.includes("gemini")) {
// Convert integer enums to string enums for Google/Gemini.
// Skip for Copilot models — they use OpenAI-compatible format and the
// Copilot API handles Gemini schema requirements internally.
if (
(model.providerID === "google" || model.api.id.includes("gemini")) &&
!model.providerID.includes("github-copilot")
) {
Comment on lines +898 to +904

Copilot AI Feb 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New behavior (skipping sanitizeGemini for github-copilot* providers) isn’t covered by unit tests. Please add a ProviderTransform.schema test case where providerID is "github-copilot" (or "github-copilot-enterprise") and api.id includes "gemini", asserting that Gemini-specific sanitization (e.g., enum-to-string conversion or stripping properties/required) does NOT occur.

Copilot uses AI. Check for mistakes.
const sanitizeGemini = (obj: any): any => {
if (obj === null || typeof obj !== "object") {
return obj
Expand Down
Loading