Skip to content

Conversation

@SannidhyaSah
Copy link
Collaborator

@SannidhyaSah SannidhyaSah commented Sep 29, 2025

Related GitHub Issue

Closes: N/A

Roo Code Task Context (Optional)

No Roo Code task context for this PR

Description

This PR removes the unsupported free version of the Gemini 2.5 Flash Image Preview model from both backend and UI components. The free endpoint is no longer available from the provider, so removing it prevents users from encountering errors when trying to use the non-functional free option.

Key implementation details:

  • Removed the free model from hardcoded arrays in both backend tool and UI component
  • Updated test files to use the paid version instead of the free version
  • Maintained backward compatibility - existing users with paid model selected are unaffected
  • No breaking changes to the API or user interface

Areas for reviewer attention:

  • Verify that only the free model was removed and paid model remains functional
  • Confirm that all test updates are appropriate and comprehensive

Test Procedure

Automated Testing:

  1. Backend tests: cd src && npx vitest run core/tools/__tests__/generateImageTool.test.ts
    • All 9 tests pass
    • Tests verify image generation functionality with paid model
  2. UI tests: cd webview-ui && npx vitest run src/components/settings/__tests__/ImageGenerationSettings.spec.tsx
    • All 5 tests pass
    • Tests verify settings component behavior with paid model

Manual Testing:

  1. Verify that the UI dropdown in experimental settings only shows the paid model option
  2. Confirm that existing configurations with paid model continue to work
  3. Check that no references to the free model remain in the codebase

Verification Commands:

  • pnpm lint - All linting passes
  • pnpm check-types - All type checking passes
  • Search for remaining references: grep -r "google/gemini-2.5-flash-image-preview:free" src/ webview-ui/ should return no results

Pre-Submission Checklist

  • Issue Linked: This PR addresses a maintenance task (removing unsupported endpoint).
  • Scope: My changes are focused on removing the unsupported free model (targeted maintenance).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: All existing tests have been updated and pass (no new functionality added).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

No visible UI changes - this is a backend model configuration change that removes a non-functional option from the dropdown

Documentation Updates

  • No documentation updates are required.

Additional Notes

This is a maintenance PR to remove a non-functional model endpoint. The free version of the Gemini 2.5 Flash Image Preview model is no longer supported by the provider, so removing it improves user experience by preventing errors when users try to select the non-working option.

The paid version remains fully functional and available. Users who were already using the paid version will see no changes in functionality.

Get in Touch

Contact through GitHub for any questions about this PR


Important

Remove unsupported Gemini 2.5 Flash Image Preview free model from backend and UI components.

  • Behavior:
    • Removed unsupported google/gemini-2.5-flash-image-preview:free model from IMAGE_GENERATION_MODELS in generateImageTool.ts and ImageGenerationSettings.tsx.
    • Updated tests in ImageGenerationSettings.spec.tsx to use the paid model.
    • Ensures backward compatibility; existing users with paid model are unaffected.
  • Testing:
    • All backend and UI tests pass, confirming functionality with the paid model.
    • Manual verification ensures no references to the free model remain.

This description was created by Ellipsis for bc50db0. You can customize this summary. It will automatically update as commits are pushed.

- Remove 'google/gemini-2.5-flash-image-preview:free' from IMAGE_GENERATION_MODELS array in generateImageTool.ts
- Remove free model option from UI ImageGenerationSettings component
- Update test files to use paid version instead of free version
- All tests passing after changes

The free endpoint is no longer supported, only the paid version remains available.
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Sep 29, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Sep 29, 2025
Copy link
Contributor

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

I found some issues that need attention around persisted configuration and UI normalization when removing the free model.


// Hardcoded list of image generation models for now
const IMAGE_GENERATION_MODELS = ["google/gemini-2.5-flash-image-preview", "google/gemini-2.5-flash-image-preview:free"]
const IMAGE_GENERATION_MODELS = ["google/gemini-2.5-flash-image-preview"]
Copy link
Contributor

Choose a reason for hiding this comment

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

P1: Removing the free model is correct, but persisted settings may still hold "google/gemini-2.5-flash-image-preview:free". The tool uses state?.openRouterImageGenerationSelectedModel without validating against the allowlist. Please coerce unknown values to the default (first entry) to avoid runtime failures for existing users with the old selection stored.


// Hardcoded list of image generation models
const IMAGE_GENERATION_MODELS = [
{ value: "google/gemini-2.5-flash-image-preview", label: "Gemini 2.5 Flash Image Preview" },
Copy link
Contributor

Choose a reason for hiding this comment

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

P2: With the free option removed, if openRouterImageGenerationSelectedModel contains the removed value, VSCodeDropdown receives a value that doesn't match any option. Consider normalizing on mount/effect: if the provided value isn’t in IMAGE_GENERATION_MODELS, set it to the default and persist via setImageGenerationSelectedModel.

{...defaultProps}
openRouterImageApiKey="existing-key"
openRouterImageGenerationSelectedModel="google/gemini-2.5-flash-image-preview:free"
openRouterImageGenerationSelectedModel="google/gemini-2.5-flash-image-preview"
Copy link
Contributor

Choose a reason for hiding this comment

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

P2: Please add a test where openRouterImageGenerationSelectedModel is an unknown (e.g., the removed ":free" value) and verify the component falls back to the default model rather than leaving the dropdown in an invalid state.

@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Review] in Roo Code Roadmap Sep 30, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 30, 2025
@mrubens
Copy link
Collaborator

mrubens commented Sep 30, 2025

What happens for people who currently have the free model selected?

@hannesrudolph hannesrudolph added PR - Needs Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Sep 30, 2025
@daniel-lxs
Copy link
Member

@mrubens The tool fails if the model tries to use it while the free variant is selected. It will keep failing. Should we migrate? I would think if someone is using it for free, migrating unexpectedly might make some people upset.

@SannidhyaSah
Copy link
Collaborator Author

What happens for people who currently have the free model selected?

The model seems to have been be deprecated for a while now . If their setting is still on it will be deselected automatically and they'll need to select the one available again

@SannidhyaSah
Copy link
Collaborator Author

@mrubens The tool fails if the model tries to use it while the free variant is selected. It will keep failing. Should we migrate? I would think if someone is using it for free, migrating unexpectedly might make some people upset.

The model was deprecated some time ago I think . It went unnoticed until someone on discord flagged this

@mrubens
Copy link
Collaborator

mrubens commented Sep 30, 2025

Failing sounds good to me, just wanted to make sure it didn't start charging without them knowing.

@mrubens mrubens merged commit e33efc6 into RooCodeInc:main Sep 30, 2025
23 checks passed
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Sep 30, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Sep 30, 2025
@SannidhyaSah SannidhyaSah deleted the remove-gemini-free-image-model branch October 26, 2025 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer PR - Needs Review size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants