-
-
Notifications
You must be signed in to change notification settings - Fork 550
Closed as not planned
Labels
area/compatCompatibility with OpenCode, DCPCompatibility with OpenCode, DCPbugSomething isn't workingSomething isn't workingduplicateThis issue or pull request already existsThis issue or pull request already exists
Description
Description
When using opencode-antigravity-auth with the Gemini API, the toGeminiSchema function does not stringify numeric enum values, causing a 400 Bad Request error.
Error Message
Schema.properties[name].enum[2]: enum value must be a STRING
The API returns errors like:
1.enum[0]: enum value must be a STRING1.enum[1]: enum value must be a STRING
Root Cause
In gemini.js, the toGeminiSchema function at lines 87-89:
else if (key === "enum" && Array.isArray(value)) {
result[key] = value; // ❌ Keeps numeric enum values as-is
}Suggested Fix
else if (key === "enum" && Array.isArray(value)) {
result[key] = value.map(v => String(v)); // ✅ Convert all values to strings
}Environment
- Plugin version: 1.4.6
- OpenCode version: latest
- API: Gemini (Google AI)
Workaround
Manually editing gemini.js in the cached plugin directory works temporarily, but gets overwritten on plugin updates.
Thanks for maintaining this plugin! 🙏
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/compatCompatibility with OpenCode, DCPCompatibility with OpenCode, DCPbugSomething isn't workingSomething isn't workingduplicateThis issue or pull request already existsThis issue or pull request already exists