Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/tools/generateImageTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { EXPERIMENT_IDS, experiments } from "../../shared/experiments"
import { OpenRouterHandler } from "../../api/providers/openrouter"

// 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

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.


export async function generateImageTool(
cline: Task,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ interface ImageGenerationSettingsProps {
// 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

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.

{ value: "google/gemini-2.5-flash-image-preview:free", label: "Gemini 2.5 Flash Image Preview (Free)" },
// Add more models as they become available
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe("ImageGenerationSettings", () => {
<ImageGenerationSettings
{...defaultProps}
openRouterImageApiKey="existing-key"
openRouterImageGenerationSelectedModel="google/gemini-2.5-flash-image-preview:free"
openRouterImageGenerationSelectedModel="google/gemini-2.5-flash-image-preview"
Copy link

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.

/>,
)

Expand Down
Loading