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
5 changes: 1 addition & 4 deletions src/core/tools/generateImageTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ import { safeWriteJson } from "../../utils/safeWriteJson"
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",
// Add more models as they become available
]
const IMAGE_GENERATION_MODELS = ["google/gemini-2.5-flash-image-preview", "google/gemini-2.5-flash-image-preview:free"]
Copy link

Choose a reason for hiding this comment

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

Would it be helpful to add tests for the generateImageTool function? Currently there's no test coverage for the image generation functionality, and it would be valuable to verify that both the paid and free models are handled correctly.

Also, for consistency with the frontend definition, should we consider formatting this array across multiple lines for better readability?

Suggested change
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",
"google/gemini-2.5-flash-image-preview:free"
]


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

Consider defining a shared constant or type for the available image generation models that can be used by both backend and frontend. This would ensure type safety and prevent potential typos or mismatches between the two lists.

{ value: "google/gemini-2.5-flash-image-preview:free", label: "Gemini 2.5 Flash Image Preview (Free)" },
Copy link

Choose a reason for hiding this comment

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

New free model option added with a hardcoded label. Consider using translation keys (via t()) for model labels to ensure internationalization consistency.

This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.

Copy link

Choose a reason for hiding this comment

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

Would it be useful to add a comment or tooltip about what "Free" means in this context? Are there any limitations users should be aware of (rate limits, quality differences, etc.)? This could help set proper expectations.

// Add more models as they become available
]

Expand Down
Loading