Skip to content

Add add-models skill#2786

Merged
wwwillchen merged 3 commits intomainfrom
agent--1771960379784-1771959504
Feb 26, 2026
Merged

Add add-models skill#2786
wwwillchen merged 3 commits intomainfrom
agent--1771960379784-1771959504

Conversation

@wwwillchen
Copy link
Copy Markdown
Collaborator

@wwwillchen wwwillchen commented Feb 25, 2026

Summary

  • Add new skill definition for under .
  • Document required workflow for adding model configurations from official docs.

Test plan

  • npm run fmt
  • npm run lint:fix
  • npm run ts

🤖 Generated with Claude Code


Open with Devin

@wwwillchen
Copy link
Copy Markdown
Collaborator Author

@BugBot run

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @wwwillchen, 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 automated skill designed to streamline the addition of AI model configurations by researching official documentation and updating relevant constants. Concurrently, it refactors the existing route parsing logic within the useParseRouter hook into modular, testable functions, enhancing code organization and maintainability.

Highlights

  • New Skill: Add Models: A new skill, dyad:add-models, has been introduced to automate the process of adding AI model configurations to the language_model_constants.ts file. This skill includes detailed instructions for researching model specifications, identifying providers, and adhering to provider-specific conventions.
  • Route Parsing Refactoring: The useParseRouter hook has been refactored to extract route parsing logic into three new, dedicated utility functions: buildRouteLabel, parseRoutesFromRouterFile, and parseRoutesFromNextFiles. This improves modularity and testability.
  • Comprehensive Unit Tests for Route Parsing: New unit tests have been added for the extracted route parsing utility functions, covering various scenarios for React Router and Next.js (both pages and app router) to ensure correctness and robustness.
Changelog
  • .claude/skills/add-models/SKILL.md
    • Added a new skill definition for dyad:add-models, detailing the step-by-step process for adding AI model configurations.
  • src/tests/useParseRouter.test.ts
    • Added a new test file containing unit tests for buildRouteLabel, parseRoutesFromRouterFile, and parseRoutesFromNextFiles.
  • src/hooks/useParseRouter.ts
    • Extracted route label building and parsing logic into buildRouteLabel, parseRoutesFromRouterFile, and parseRoutesFromNextFiles functions.
    • Updated the useEffect hook to utilize these new utility functions for route parsing.
Activity
  • The pull request was generated using Claude Code.
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.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Feb 25, 2026

Greptile Summary

This PR adds support for three new AI models (Claude Sonnet 4.6, Gemini 3.1 Pro Preview, and MiniMax M2.5) and introduces a comprehensive skill definition for adding models in the future.

Key Changes:

  • Added dyad:add-models skill with detailed instructions for researching and adding new models from official documentation
  • Added Claude Sonnet 4.6 as the new default Sonnet model, updated SONNET_4_6 constant and all references
  • Updated Gemini model from gemini-3-pro-preview to gemini-3.1-pro-preview with improved description
  • Added MiniMax M2.5 model to OpenRouter provider with appropriate specs
  • Updated get_model_client.ts to use the new SONNET_4_6 constant

Issues Found:

  • The Gemini model name change from gemini-3-pro-preview to gemini-3.1-pro-preview was not propagated to src/pro/main/ipc/handlers/themes_handlers.ts:40, which will cause the theme generation feature to reference a non-existent model name

Confidence Score: 3/5

  • This PR has one critical bug that will break theme generation functionality
  • The PR adds three new models correctly with proper specs and documentation, and introduces a helpful skill definition. However, there's a logic bug where the Gemini model name was changed in the constants but the old name is still hardcoded in themes_handlers.ts, which will cause runtime errors when theme generation attempts to use that model.
  • Pay close attention to src/ipc/shared/language_model_constants.ts - the Gemini model name change needs to be propagated to themes_handlers.ts

Important Files Changed

Filename Overview
.claude/skills/add-models/SKILL.md New skill definition with comprehensive instructions for adding AI models to the project
src/ipc/shared/language_model_constants.ts Added Sonnet 4.6, Gemini 3.1 Pro, MiniMax M2.5; renamed SONNET_4_5 to SONNET_4_6; missing update to themes_handlers.ts
src/ipc/utils/get_model_client.ts Updated references from SONNET_4_5 to SONNET_4_6 constant

Last reviewed commit: 4f85b87

Copy link
Copy Markdown
Contributor

@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 add-models skill and refactors the route parsing logic in useParseRouter.ts for improved consistency and testability. However, security vulnerabilities were found: a Medium-severity ReDoS in the route parsing and a High-severity LLM Safety issue in the new skill definition, potentially leading to code injection. The LLM Safety issue is highlighted with a rule reference emphasizing the need for input sanitization. Further code review feedback includes suggestions for filtering dynamic routes from React Router parsing and removing redundant code to enhance maintainability.

Comment on lines +41 to +66
4. **Research each model's specifications:**

For each model, use WebSearch and WebFetch to look up the official documentation:
- **Anthropic models**: Search `docs.anthropic.com` for model specs
- **OpenAI models**: Search `platform.openai.com/docs/models` for model specs
- **Google Gemini models**: Search `ai.google.dev/gemini-api/docs/models` for model specs
- **xAI models**: Search `docs.x.ai/docs/models` for model specs
- **OpenRouter models**: Search `openrouter.ai/<provider>/<model-name>` for model specs and pricing

For each model, determine:
- **API model name**: The exact string used in API calls (e.g., `claude-sonnet-4-5-20250929`, `gemini-2.5-pro`)
- **Display name**: Human-readable name (e.g., "Claude Sonnet 4.5", "Gemini 2.5 Pro")
- **Description**: Short description following the style of existing entries
- **Max output tokens**: The model's maximum output token limit
- **Context window**: The model's total context window size
- **Temperature**: Default temperature (0 for most models, 1 for OpenAI, 1.0 for Gemini 3.x models)
- **Dollar signs**: Cost tier from 0-6 based on pricing relative to other models in the same provider

**Dollar signs guide** (approximate, based on per-million-token input pricing):
- 0: Free
- 1: Very cheap (<$0.50/M input tokens)
- 2: Cheap ($0.50-$2/M)
- 3: Moderate ($2-$8/M)
- 4: Expensive ($8-$15/M)
- 5: Very expensive ($15-$30/M)
- 6: Premium ($30+/M)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

security-high high

This skill definition creates a 'Data-to-Code' pipeline where an AI agent is instructed to fetch model specifications from external websites and write them directly into the codebase (src/ipc/shared/language_model_constants.ts). This is vulnerable to Indirect Prompt Injection. An attacker who controls the content of the documentation pages fetched by the agent could trick it into injecting malicious code, backdoors, or logic flaws into the repository. The instructions should be updated to include strict validation and sanitization requirements for all data fetched from external sources before it is written to the codebase.

References
  1. Sanitize user-provided input, such as keywords, before incorporating it into an LLM prompt to prevent prompt injection. Sanitization should include stripping HTML-like tags, removing code block markers, and enforcing length limits.

Comment on lines +122 to +131
it("should include dynamic routes with params (they are valid navigation targets with placeholders)", () => {
const content = `
<Routes>
<Route path="/users/:id" element={<User />} />
</Routes>
`;
const routes = parseRoutesFromRouterFile(content);
expect(routes).toHaveLength(1);
expect(routes[0].path).toBe("/users/:id");
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

This test asserts that dynamic routes with params are included. However, for consistency with how Next.js routes are parsed (which excludes them) and for the purpose of a "quick navigation" feature, these routes should be excluded as they are not directly navigable. This test should be updated to assert that dynamic routes are not included.

  it("should NOT include dynamic routes with params as they are not directly navigable", () => {
    const content = `
      <Routes>
        <Route path="/users/:id" element={<User />} />
        <Route path="/dashboard" element={<Dashboard />} />
      </Routes>
    `;
    const routes = parseRoutesFromRouterFile(content);
    expect(routes).toHaveLength(1);
    expect(routes[0].path).toBe("/dashboard");
  });

Comment on lines +42 to +44
// Skip wildcard/catch-all routes like "*" - they are not valid navigation targets
// and cause 'Invalid URL' TypeError when clicked
if (path === "*" || path === "/*") continue;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The parseRoutesFromRouterFile function currently includes dynamic routes (e.g., /users/:id), while parseRoutesFromNextFiles correctly excludes them. For consistency, and because dynamic routes are not directly navigable without parameters, they should also be excluded here. This will make the "quick navigation" feature more reliable and consistent across different project types.

Suggested change
// Skip wildcard/catch-all routes like "*" - they are not valid navigation targets
// and cause 'Invalid URL' TypeError when clicked
if (path === "*" || path === "/*") continue;
// Skip wildcard/catch-all and dynamic routes as they are not valid navigation targets
// and can cause errors or are not directly navigable.
if (path === "*" || path === "/*" || path.includes(":")) continue;


try {
const parsedRoutes: ParsedRoute[] = [];
const routePathsRegex = /<Route\s+(?:[^>]*\s+)?path=["']([^"']+)["']/g;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

security-medium medium

The regular expression used to parse routes is vulnerable to Regular Expression Denial of Service (ReDoS). The overlapping sub-patterns [^>]* and \s+ within the optional group (?:[^>]*\s+)? can cause catastrophic backtracking when processing long strings inside a <Route> tag that do not contain the path attribute. This could hang the UI thread if a large or maliciously crafted file is processed.

Suggested change
const routePathsRegex = /<Route\s+(?:[^>]*\s+)?path=["']([^"']+)["']/g;
const routePathsRegex = /<Route\s+[^>]*?path=["']([^"']+)["']/g;

- **OpenAI** (`openai`): GPT models
- **Google** (`google`): Gemini models
- **xAI** (`xai`): Grok models
- **OpenRouter** (`openrouter`): Models from other providers (DeepSeek, Qwen, Moonshot/Kimi, Z-AI/GLM, etc.)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

For consistency with the model names used in src/ipc/shared/language_model_constants.ts (e.g., z-ai/glm-5), it's better to use the lowercase z-ai/glm here. The current Z-AI/GLM might cause confusion or require extra normalization steps for the agent following these instructions.

Suggested change
- **OpenRouter** (`openrouter`): Models from other providers (DeepSeek, Qwen, Moonshot/Kimi, Z-AI/GLM, etc.)
- **OpenRouter** (`openrouter`): Models from other providers (DeepSeek, Qwen, Moonshot/Kimi, z-ai/glm, etc.)

Comment on lines +93 to +108
const lower = file.toLowerCase();
if (
lower === "app/page.tsx" ||
lower === "app/page.jsx" ||
lower === "app/page.js" ||
lower === "app/page.mdx" ||
lower === "app/page.ts" ||
lower === "src/app/page.tsx" ||
lower === "src/app/page.jsx" ||
lower === "src/app/page.js" ||
lower === "src/app/page.mdx" ||
lower === "src/app/page.ts"
) {
nextRoutes.add("/");
continue;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This block of code to specifically handle root-level page files (e.g., app/page.tsx, src/app/page.tsx) is redundant. The subsequent logic using appPageRegex already correctly handles these cases by matching them and producing an empty routeSeg, which then correctly resolves to the root path /. Removing this block will simplify the code and improve maintainability without changing functionality.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 3 additional findings in Devin Review.

Open in Devin Review

const path = match[1];
// Skip wildcard/catch-all routes like "*" - they are not valid navigation targets
// and cause 'Invalid URL' TypeError when clicked
if (path === "*" || path === "/*") continue;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Wildcard route filtering is incomplete — paths like /dashboard/* are not excluded

The wildcard filter at line 44 only checks for exact "*" and "/*" paths, but React Router apps commonly use nested wildcard routes like <Route path="/dashboard/*" ... />. These paths still contain *, which is not a valid URL path character and will cause the same Invalid URL TypeError the filter was designed to prevent.

Root Cause and Impact

The filter if (path === "*" || path === "/*") continue; is too narrow. When the parsed route /dashboard/* is displayed in the navigation dropdown (src/components/preview_panel/PreviewIframe.tsx:1159), clicking it calls navigateToRoute("/dashboard/*"), which eventually constructs a URL containing the literal * character. This triggers the same Invalid URL TypeError that the comment on line 42-43 warns about.

A more robust check would use path.includes("*") or path.endsWith("/*") to catch all wildcard patterns:

if (path.includes("*")) continue;
Suggested change
if (path === "*" || path === "/*") continue;
if (path.includes("*")) continue;
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d0585f1876

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const path = match[1];
// Skip wildcard/catch-all routes like "*" - they are not valid navigation targets
// and cause 'Invalid URL' TypeError when clicked
if (path === "*" || path === "/*") continue;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep /* routes in parsed navigation list

The new wildcard filter drops path === "/*", but this pattern is a valid React Router route and is commonly used as the top-level route for nested routing trees. In apps that declare only /* in App.tsx, this change removes the only discovered route from quick navigation, even though navigation to that absolute path is valid; the Invalid URL problem applies to bare "*", not "/*".

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Multi-agent review: 1 issue found

const path = match[1];
// Skip wildcard/catch-all routes like "*" - they are not valid navigation targets
// and cause 'Invalid URL' TypeError when clicked
if (path === "*" || path === "/*") continue;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 MEDIUM | edge-case

Incomplete wildcard route filtering misses nested catch-all patterns

The wildcard filter only checks for exact "*" and "/*" paths, but React Router also supports nested catch-all routes like "/admin/*" or "/docs/*". These routes contain * and would similarly cause the 'Invalid URL' TypeError mentioned in the comment, yet they pass through this filter.

💡 Suggestion: Use path.includes('*') instead of exact equality checks:

Suggested change
if (path === "*" || path === "/*") continue;
if (path.includes('*')) continue;

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Dyadbot Code Review Summary

Verdict: ✅ YES - Ready to merge

Reviewed by 3 independent agents: Correctness Expert, Code Health Expert, UX Wizard.

Issues Summary

Severity File Issue
🟡 MEDIUM src/hooks/useParseRouter.ts:44 Incomplete wildcard route filtering misses nested catch-all patterns
🟢 Low Priority Notes (3 items)
  • Verbose root app-page detection - src/hooks/useParseRouter.ts:94-104 - The 10-way || chain for root page detection could be replaced with a single regex like /^(?:src\/)?app\/page\.(?:js|jsx|ts|tsx|mdx)$/i
  • Unnecessary non-capturing group in regex - src/hooks/useParseRouter.ts:64 - (?:pages) is functionally identical to pages and the non-capturing group adds no value
  • PR bundles unrelated changes - The PR title says "Add add-models skill" but also includes a significant useParseRouter refactor with new tests. Consider splitting or updating the PR description
🚫 Dropped False Positives (2 items)
  • Dynamic routes shown as clickable navigation targets - Dropped: Pre-existing behavior faithfully preserved by the refactoring, not introduced by this PR
  • buildRouteLabel only capitalizes first character - Dropped: Pre-existing style choice, the function was just extracted from the useEffect without changes

Generated by Dyadbot multi-agent code review

@github-actions github-actions bot added the needs-human:review-issue ai agent flagged an issue that requires human review label Feb 25, 2026
@wwwillchen
Copy link
Copy Markdown
Collaborator Author

@BugBot run

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Dyadbot Code Review Summary

Verdict: ✅ YES - Ready to merge

Reviewed by 3 independent agents: Correctness Expert, Code Health Expert, UX Wizard.

✅ No blocking issues found. This is a well-structured skill definition that adds clear, actionable instructions for adding AI model configurations.

🟢 Low Priority Notes (2 items)
  • TURBO_MODELS guidance could be more precise - .claude/skills/add-models/SKILL.md:86-88 - The term "turbo variant" is vague; TURBO_MODELS is actually a curated list of fast OpenRouter cloud models for the auto provider, and uses a different schema (LanguageModel[] vs ModelOption[]). In practice, the agent reads the constants file in step 2 and npm run ts in step 8 catches schema mismatches, so this self-corrects.
  • Vertex provider convention not explicitly listed in step 5 - .claude/skills/add-models/SKILL.md:69-77 - Step 5 lists conventions for 7 providers but not Vertex separately (it's mentioned in the Google parenthetical). Again, self-corrects via step 2.
🚫 Dropped False Positives (5 items)
  • maxOutputTokens convention attributed only to Vertex - Dropped: The instruction correctly specifies the value for the Google provider; the parenthetical explains the reasoning, not the scope
  • Missing CLOUD_PROVIDERS/PROVIDER_TO_ENV_VAR guidance - Dropped: Adding an entirely new provider is an edge case outside this skill's primary scope (adding models to existing providers)
  • grep pattern searches for existing constants - Dropped: The grep example intentionally shows existing constants as reference patterns to help the agent understand the naming convention
  • Anthropic model name example outdated - Dropped: claude-sonnet-4-20250514 is a valid model name; the agent reads the actual file in step 2 and learns the current conventions
  • Raw grep command instead of Grep tool - Dropped: Agents routinely interpret shell commands as guidance and use appropriate tools

Generated by Dyadbot multi-agent code review

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Add three new models to language_model_constants.ts:
- Gemini 3.1 Pro (Preview) in Google provider
- Claude Sonnet 4.6 in Anthropic provider
- MiniMax M2.5 in OpenRouter provider

Replace SONNET_4_5 constant with SONNET_4_6 and update smart auto
model references to use Sonnet 4.6.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@wwwillchen
Copy link
Copy Markdown
Collaborator Author

@BugBot run

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 7 additional findings in Devin Review.

Open in Devin Review

name: "gemini-3-pro-preview",
displayName: "Gemini 3 Pro (Preview)",
description: "Google's latest Gemini model",
name: "gemini-3.1-pro-preview",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔴 Theme generation sends stale model name gemini-3-pro-preview after rename to gemini-3.1-pro-preview

When a user selects the Gemini model for AI theme generation, the THEME_GENERATION_MODEL_MAP in themes_handlers.ts:40 still maps to the old model name gemini-3-pro-preview, but this PR renamed that model to gemini-3.1-pro-preview in the constants file. This causes the theme generation API call to use a model name that no longer exists.

Root Cause and Impact

The PR changed the Google model entry in src/ipc/shared/language_model_constants.ts:174 from name: "gemini-3-pro-preview" to name: "gemini-3.1-pro-preview", but did not update the hardcoded model name in src/pro/main/ipc/handlers/themes_handlers.ts:40:

const THEME_GENERATION_MODEL_MAP = {
  "gemini-3-pro": { provider: "google", name: "gemini-3-pro-preview" }, // stale!
  ...
};

This name value is passed directly to getModelClient() at themes_handlers.ts:614 and themes_handlers.ts:840, which uses it as the API model identifier sent to Google's API. Since the model was renamed (presumably because Google updated the model), the old name gemini-3-pro-preview will likely result in an API error when users try to generate themes with the default Gemini model selection.

Impact: Theme generation (both from images and from URLs) will fail for all users who select the default Gemini model option.

Prompt for agents
Update the THEME_GENERATION_MODEL_MAP in src/pro/main/ipc/handlers/themes_handlers.ts line 40 to use the new model name. Change:

  "gemini-3-pro": { provider: "google", name: "gemini-3-pro-preview" },

to:

  "gemini-3-pro": { provider: "google", name: "gemini-3.1-pro-preview" },

Also consider whether the UI-facing key "gemini-3-pro" (used in src/ipc/types/templates.ts:97 and src/components/AIGeneratorTab.tsx:27,519,521) should be updated to reflect the new model version name.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3143682411

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

name: "gemini-3-pro-preview",
displayName: "Gemini 3 Pro (Preview)",
description: "Google's latest Gemini model",
name: "gemini-3.1-pro-preview",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep Gemini model IDs consistent across theme generation

Changing the Google flagship model ID to gemini-3.1-pro-preview here leaves the theme-generation path pinned to the old gemini-3-pro-preview ID (THEME_GENERATION_MODEL_MAP in src/pro/main/ipc/handlers/themes_handlers.ts:40), so users selecting Gemini for theme generation do not actually use the newly added model and may fail once the old preview is unavailable. This model-ID update should be applied to that map (and related theme model metadata) in the same change to avoid drift.

Useful? React with 👍 / 👎.

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Dyadbot Code Review Summary

Verdict: 🤔 NOT SURE - Potential issues

Reviewed by 3 independent agents: Correctness Expert, Code Health Expert, UX Wizard.

Issues Summary

Severity File Issue
🔴 HIGH src/pro/main/ipc/handlers/themes_handlers.ts:40 Stale gemini-3-pro-preview model reference will break theme generation

Details on HIGH issue:

The THEME_GENERATION_MODEL_MAP in themes_handlers.ts:40 still maps "gemini-3-pro" to { provider: "google", name: "gemini-3-pro-preview" }, but this PR removes the gemini-3-pro-preview entry from MODEL_OPTIONS and replaces it with gemini-3.1-pro-preview. When a user selects "Gemini 3 Pro" in the AI theme generator, the system will attempt to use a model name that no longer exists in the constants and may fail if Google deprecates the old API name. The UI label in AIGeneratorTab.tsx also still says "Gemini 3 Pro" rather than "Gemini 3.1 Pro".

💡 Suggestion: Update themes_handlers.ts to map to "gemini-3.1-pro-preview" and update the UI label to match.

🟢 Low Priority Notes (2 items)
  • Stale SONNET_4_5 reference in skill instructions - .claude/skills/add-models/SKILL.md:92-95 - The grep example references SONNET_4_5 but this PR renames the constant to SONNET_4_6. Future agents using this skill may search for a non-existent constant.
  • MiniMax M2.5 description is vague - src/ipc/shared/language_model_constants.ts:267 - "Strong cost-effective model for real-world productivity" is generic compared to other entries that mention coding. Could be more specific about the model's strengths.
🚫 Dropped False Positives (3 items)
  • Sonnet 4.6 description diverges from Sonnet family - Dropped: Intentional differentiation — "fast and intelligent" vs "best for coding" helps users choose between models
  • Gemini 3 Pro still listed alongside 3.1 Pro - Dropped: Verified that Gemini 3 Pro was fully replaced by 3.1 Pro in the constants; the old entry no longer exists
  • Comment URL above Gemini 3 Flash references gemini-3-pro - Dropped: Pre-existing issue not introduced by this PR

Generated by Dyadbot multi-agent code review

@github-actions
Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results

✅ All tests passed!

OS Passed Flaky Skipped
🍎 macOS 234 10 6

Total: 234 tests passed (10 flaky) (6 skipped)

⚠️ Flaky Tests

🍎 macOS

  • annotator.spec.ts > annotator - capture and submit screenshot (passed after 1 retry)
  • context_manage.spec.ts > manage context - smart context (passed after 1 retry)
  • debugging_logs.spec.ts > clicking send to chat button adds log to chat input (passed after 1 retry)
  • hmr_path.spec.ts > HMR after navigating back to root should stay on root (passed after 1 retry)
  • refresh.spec.ts > spa navigation inside iframe does not change iframe src attribute (passed after 1 retry)
  • select_component.spec.ts > select component next.js (passed after 1 retry)
  • setup_flow.spec.ts > Setup Flow > setup banner shows correct state when node.js is installed (passed after 1 retry)
  • setup.spec.ts > setup ai provider (passed after 1 retry)
  • toggle_screen_sizes.spec.ts > Toggle Screen Size Tests > should persist device mode after rebuild (passed after 1 retry)
  • undo.spec.ts > undo with native git (passed after 1 retry)

📊 View full report

@wwwillchen
Copy link
Copy Markdown
Collaborator Author

@BugBot run

@wwwillchen wwwillchen merged commit fe08522 into main Feb 26, 2026
9 of 11 checks passed
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is ON, but it could not run because Privacy Mode (Legacy) is turned on. To enable Bugbot Autofix, switch your privacy mode in the Cursor dashboard.

description: "Google's latest Gemini model",
name: "gemini-3.1-pro-preview",
displayName: "Gemini 3.1 Pro (Preview)",
description: "Google's most capable Gemini model",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Theme generation uses removed Gemini model

High Severity

The diff replaces gemini-3-pro-preview with gemini-3.1-pro-preview in MODEL_OPTIONS, but THEME_GENERATION_MODEL_MAP in themes_handlers.ts still maps the Gemini theme option to gemini-3-pro-preview. Theme generation therefore uses a model that was removed from the codebase, which can cause API errors if Google has deprecated it, or at least leaves the feature using a deprecated model.

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

4 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

name: "gemini-3-pro-preview",
displayName: "Gemini 3 Pro (Preview)",
description: "Google's latest Gemini model",
name: "gemini-3.1-pro-preview",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Model name was changed from gemini-3-pro-preview to gemini-3.1-pro-preview, but src/pro/main/ipc/handlers/themes_handlers.ts:40 still references the old name.

Suggested change
name: "gemini-3.1-pro-preview",
name: "gemini-3.1-pro-preview",

Also update themes_handlers.ts line 40 to use the new name.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/ipc/shared/language_model_constants.ts
Line: 174

Comment:
Model name was changed from `gemini-3-pro-preview` to `gemini-3.1-pro-preview`, but `src/pro/main/ipc/handlers/themes_handlers.ts:40` still references the old name.

```suggestion
      name: "gemini-3.1-pro-preview",
```

Also update `themes_handlers.ts` line 40 to use the new name.

How can I resolve this? If you propose a fix, please make it concise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-human:review-issue ai agent flagged an issue that requires human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant