Conversation
1. Claude translator: add CleanJSONSchemaForGemini() to sanitize tool input schemas (removes $schema, anyOf, const, format, etc.) and delete eager_input_streaming from tool declarations. Remove fragile bytes.Replace for format:"uri" now covered by schema cleaner. 2. Gemini native translator: filter out content entries with empty or missing parts arrays to prevent Gemini API 400 error "required oneof field 'data' must have one initialized field". Both fixes align gemini-cli with protections already present in the antigravity translator.
fix(config): allow vertex keys without base-url
…-empty-parts fix(gemini-cli): sanitize tool schemas and filter empty parts
feat(service): extend model registration for team and business types
Fix missing streaming usage tracking for OpenAI-compatible providers
docs: Add Shadow AI to 'Who is with us?' section
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request, labeled v6.8.53, focuses on refining API integrations and improving compatibility across various AI models. It introduces more flexible configuration options for Vertex API keys, ensures better capture of usage data during OpenAI-compatible streaming, and enhances the robustness of Gemini CLI request translations. Additionally, it updates project documentation and expands support for specific Codex model tiers. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request appears to be a patch release, v6.8.53. The changes include making base-url optional for Vertex-compatible keys, adding validation for Vertex API keys, enabling usage statistics for OpenAI-compatible streaming responses, and fixing an issue with Gemini API requests by filtering out content with empty parts. There are also documentation updates and minor refactorings. The overall changes improve the robustness and functionality of the proxy. My review includes one suggestion for a more efficient implementation of content filtering.
| filteredContents := "[]" | ||
| hasFiltered := false | ||
| gjson.GetBytes(rawJSON, "request.contents").ForEach(func(_, content gjson.Result) bool { | ||
| parts := content.Get("parts") | ||
| if !parts.IsArray() || len(parts.Array()) == 0 { | ||
| hasFiltered = true | ||
| return true | ||
| } | ||
| filteredContents, _ = sjson.SetRaw(filteredContents, "-1", content.Raw) | ||
| return true | ||
| }) | ||
| if hasFiltered { | ||
| rawJSON, _ = sjson.SetRawBytes(rawJSON, "request.contents", []byte(filteredContents)) | ||
| } |
There was a problem hiding this comment.
For filtering the contents array, instead of creating a new JSON array string and replacing the old one, you could consider an in-place removal approach. This can be more efficient, especially if only a few items need to be removed, as it avoids reconstructing the entire array.
You can collect the indices of items to be deleted and then remove them from the JSON using sjson.DeleteBytes, iterating backwards to avoid index shifting issues.
| filteredContents := "[]" | |
| hasFiltered := false | |
| gjson.GetBytes(rawJSON, "request.contents").ForEach(func(_, content gjson.Result) bool { | |
| parts := content.Get("parts") | |
| if !parts.IsArray() || len(parts.Array()) == 0 { | |
| hasFiltered = true | |
| return true | |
| } | |
| filteredContents, _ = sjson.SetRaw(filteredContents, "-1", content.Raw) | |
| return true | |
| }) | |
| if hasFiltered { | |
| rawJSON, _ = sjson.SetRawBytes(rawJSON, "request.contents", []byte(filteredContents)) | |
| } | |
| indicesToDelete := []int{} | |
| gjson.GetBytes(rawJSON, "request.contents").ForEach(func(key, content gjson.Result) bool { | |
| parts := content.Get("parts") | |
| if !parts.IsArray() || len(parts.Array()) == 0 { | |
| indicesToDelete = append(indicesToDelete, int(key.Int())) | |
| } | |
| return true | |
| }) | |
| if len(indicesToDelete) > 0 { | |
| // Iterate backwards to avoid index shifting issues during deletion. | |
| for i := len(indicesToDelete) - 1; i >= 0; i-- { | |
| path := fmt.Sprintf("request.contents.%d", indicesToDelete[i]) | |
| rawJSON, _ = sjson.DeleteBytes(rawJSON, path) | |
| } | |
| } |
No description provided.