-
-
Notifications
You must be signed in to change notification settings - Fork 40
v6.5.31 #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v6.5.31 #1
Conversation
docs: add CCS (Claude Code Switch) to projects list
…ecutors Extract applyThinkingMetadata and applyThinkingMetadataCLI helpers to payload_helpers.go and use them across all four Gemini-based executors: - gemini_executor.go (Execute, ExecuteStream, CountTokens) - gemini_cli_executor.go (Execute, ExecuteStream, CountTokens) - aistudio_executor.go (translateRequest) - antigravity_executor.go (Execute, ExecuteStream) This eliminates code duplication introduced in the -reasoning suffix PR and centralizes the thinking config application logic. Net reduction: 28 lines of code.
…-helpers refactor(executor): dedupe thinking metadata helpers across Gemini executors
Summary of ChangesHello @luispater, 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 primarily focuses on improving the maintainability and reusability of the code responsible for applying 'thinking metadata' to AI model requests, specifically for Gemini and Antigravity. By centralizing this logic into dedicated helper functions, the individual executor implementations are simplified. Additionally, the project's documentation has been updated to feature a new, related CLI tool. Highlights
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request refactors the logic for applying 'thinking' metadata by centralizing it into helper functions in a new payload_helpers.go file. This is a good improvement for code maintainability and reduces duplication. However, I've found an issue in the implementation of applyThinkingMetadataCLI which leads to inconsistent and inefficient behavior. My review includes a suggestion to fix this.
| func applyThinkingMetadataCLI(payload []byte, metadata map[string]any, model string) []byte { | ||
| budgetOverride, includeOverride, ok := util.GeminiThinkingFromMetadata(metadata) | ||
| if !ok { | ||
| return payload | ||
| } | ||
| if budgetOverride != nil && util.ModelSupportsThinking(model) { | ||
| norm := util.NormalizeThinkingBudget(model, *budgetOverride) | ||
| budgetOverride = &norm | ||
| } | ||
| return util.ApplyGeminiCLIThinkingConfig(payload, budgetOverride, includeOverride) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation of applyThinkingMetadataCLI is inconsistent with applyThinkingMetadata and can lead to inefficient processing. Specifically, it doesn't check if the model supports thinking before attempting to apply the configuration. This is problematic in gemini_cli_executor.go, where util.StripThinkingConfigIfUnsupported is called immediately after, causing the configuration to be applied and then potentially stripped right away if the model doesn't support it.
To improve consistency and efficiency, this function should check for model support early, similar to applyThinkingMetadata.
| func applyThinkingMetadataCLI(payload []byte, metadata map[string]any, model string) []byte { | |
| budgetOverride, includeOverride, ok := util.GeminiThinkingFromMetadata(metadata) | |
| if !ok { | |
| return payload | |
| } | |
| if budgetOverride != nil && util.ModelSupportsThinking(model) { | |
| norm := util.NormalizeThinkingBudget(model, *budgetOverride) | |
| budgetOverride = &norm | |
| } | |
| return util.ApplyGeminiCLIThinkingConfig(payload, budgetOverride, includeOverride) | |
| } | |
| func applyThinkingMetadataCLI(payload []byte, metadata map[string]any, model string) []byte { | |
| budgetOverride, includeOverride, ok := util.GeminiThinkingFromMetadata(metadata) | |
| if !ok { | |
| return payload | |
| } | |
| if !util.ModelSupportsThinking(model) { | |
| return payload | |
| } | |
| if budgetOverride != nil { | |
| norm := util.NormalizeThinkingBudget(model, *budgetOverride) | |
| budgetOverride = &norm | |
| } | |
| return util.ApplyGeminiCLIThinkingConfig(payload, budgetOverride, includeOverride) | |
| } |
- Added setKiroIncognitoMode() helper function to handle Kiro auth incognito mode setting - Replaced 3 duplicate code blocks (21 lines) with single function calls (3 lines) - Kiro auth defaults to incognito mode for multi-account support - Users can override with --incognito or --no-incognito flags This addresses the code duplication noted in PR #1 review.
Correct config in README.md
No description provided.