Skip to content

v6.7.26#138

Merged
luispater merged 8 commits intomainfrom
plus
Jan 27, 2026
Merged

v6.7.26#138
luispater merged 8 commits intomainfrom
plus

Conversation

@luispater
Copy link

No description provided.

@gemini-code-assist
Copy link

Summary of Changes

Hello @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 introduces a new API endpoint for retrieving static model definitions, enhancing the API's ability to provide structured metadata for various AI providers. It significantly refactors the internal model registry by separating static data into a dedicated file and centralizing the retrieval logic. This improves code organization and maintainability. Additionally, a critical fix was implemented for Gemini schema conversion to ensure proper enum handling, addressing potential compatibility issues.

Highlights

  • New API Endpoint for Model Definitions: A new API endpoint, /model-definitions/:channel, has been introduced to allow retrieval of static model metadata for specific AI providers or 'channels'.
  • Refactored Model Definition Storage: Static model definitions for various AI providers (Claude, Gemini, OpenAI, Qwen, iFlow, Antigravity) have been moved from internal/registry/model_definitions.go to a new, dedicated file internal/registry/model_definitions_static_data.go for better organization.
  • Centralized Model Definition Retrieval Logic: A new dispatcher function, GetStaticModelDefinitionsByChannel, has been added to internal/registry/model_definitions.go to centralize the logic for fetching model definitions based on a given channel string.
  • Gemini Schema Compatibility Fix: The convertEnumValuesToStrings utility function was updated to explicitly set the schema type to 'string' for enum fields, ensuring compatibility with Antigravity Gemini's schema requirements.
  • Dependency Management Update: The golang.org/x/text dependency in go.mod was reclassified from a direct requirement to an indirect dependency.

🧠 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.

Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@luispater luispater merged commit 8f522ee into router-for-me:main Jan 27, 2026
2 checks passed
Copy link

@gemini-code-assist gemini-code-assist bot left a 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 introduces a new API endpoint for retrieving static model definitions by channel and refactors the model registry to separate static data from the registry logic. It also includes minor dependency updates in go.mod. The main changes involve adding a new handler function, modifying the routing configuration, and reorganizing the model definition data. The review focuses on the correctness and maintainability of the new endpoint and the refactored registry.

I am having trouble creating individual review comments. Click here to see my feedback.

internal/util/gemini_schema.go (188-190)

high

The stringVals variable is populated with item.String() without checking the item type. It's better to validate that item is actually a string before appending it to stringVals to avoid potential runtime errors.

go.mod (24)

medium

This line was removed, but it's added again as an indirect dependency. Is this intentional? If golang.org/x/text is actually needed, it should be kept as a direct dependency to avoid potential issues with transitive dependency resolution.

internal/registry/model_definitions.go (23)

medium

The function GetStaticModelDefinitionsByChannel could benefit from input validation to prevent nil pointer dereferences or unexpected behavior if the channel string contains unusual characters or is excessively long. Consider adding a check for invalid characters or length limits.

internal/registry/model_definitions.go (61-63)

medium

The sorting logic here sorts model IDs lexicographically, which might not be the most intuitive order for users. Consider sorting by a different criteria, such as model creation date or a custom priority, to provide a more user-friendly ordering.

internal/util/gemini_schema.go (178)

medium

The comment says "ensures all enum values are strings and the schema type is set to string", but the code suggestion also sets the type to string. This redundancy should be removed.

// convertEnumValuesToStrings ensures all enum values are strings.
// Gemini API requires enum values to be of type string, not numbers or booleans.

internal/util/gemini_schema.go (192-196)

medium

Setting the type to "string" unconditionally might override a more specific type that was intended for the enum. Consider preserving the original type if it's compatible with string representation or providing a mechanism to handle different types appropriately.

@luispater luispater deleted the plus branch January 27, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants