Skip to content

feat(copilot): gemini 2.5 thinking mode support #1949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2025
Merged

Conversation

ysfscream
Copy link
Member

@ysfscream ysfscream commented Jun 25, 2025

PR Checklist

If you have any questions, you can refer to the Contributing Guide

What is the current behavior?

image

Please describe the current behavior and link to a relevant issue.

Issue Number

Example: #123

What is the new behavior?

image

Please describe the new behavior or provide screenshots.

Does this PR introduce a breaking change?

  • Yes
  • No

Specific Instructions

Are there any specific instructions or things that should be known prior to review?

Other information

@ysfscream ysfscream added this to the v1.12.0 milestone Jun 25, 2025
@ysfscream ysfscream requested review from Red-Asuka and Copilot June 25, 2025 07:10
@ysfscream ysfscream self-assigned this Jun 25, 2025
@ysfscream ysfscream added the enhancement New feature or request label Jun 25, 2025
@ysfscream ysfscream added this to MQTTX Jun 25, 2025
@ysfscream ysfscream added feature This pr is a feature desktop MQTTX Desktop labels Jun 25, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for Gemini 2.5 thinking variants by registering new model identifiers, updating the agent logic to detect and configure “thinking” modes for Google models, adjusting tests, and bumping the Google SDK dependency.

  • Register new Gemini 2.5 models (including thinking and flash variants) in AImodelsOptions
  • Extend AIAgent.processModel to detect and handle Google thinking models
  • Update unit tests to include the new Gemini 2.5 options and bump @ai-sdk/google version

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
tests/unit/utils/ai/copilot.spec.ts Added assertions for gemini-2.5-pro and gemini-2.5-pro-thinking, updated provider test model
src/utils/ai/copilot.ts Registered new Gemini 2.5 model variants in the AI models options
src/utils/ai/AIAgent.ts Implemented isGoogleThinking detection and adjusted request payload for thinking models
package.json Bumped @ai-sdk/google dependency to ^1.2.12
Comments suppressed due to low confidence (1)

src/utils/ai/AIAgent.ts:173

  • Add unit tests for the isGoogleThinking branch in processModel to verify that it correctly trims the -thinking suffix and sets isGoogleThinking to true for models like gemini-2.5-pro-thinking.
    const isGoogleThinking = model.includes('gemini') && model.endsWith('-thinking')

Comment on lines +86 to 88
expect(google?.children.map((c) => c.value)).to.include('gemini-2.5-pro')
expect(google?.children.map((c) => c.value)).to.include('gemini-2.5-pro-thinking')
expect(google?.children.map((c) => c.value)).to.include('gemini-1.5-pro')
Copy link
Preview

Copilot AI Jun 25, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider extracting google?.children.map(c => c.value) into a single variable to avoid repeated mapping and improve readability.

Suggested change
expect(google?.children.map((c) => c.value)).to.include('gemini-2.5-pro')
expect(google?.children.map((c) => c.value)).to.include('gemini-2.5-pro-thinking')
expect(google?.children.map((c) => c.value)).to.include('gemini-1.5-pro')
const googleChildrenValues = google?.children.map((c) => c.value)
expect(googleChildrenValues).to.include('gemini-2.5-pro')
expect(googleChildrenValues).to.include('gemini-2.5-pro-thinking')
expect(googleChildrenValues).to.include('gemini-1.5-pro')

Copilot uses AI. Check for mistakes.

@ysfscream ysfscream moved this to In Progress in MQTTX Jun 25, 2025
@Red-Asuka Red-Asuka merged commit 83147fc into main Jun 25, 2025
4 checks passed
@Red-Asuka Red-Asuka deleted the ysf/desktop branch June 25, 2025 07:24
@github-project-automation github-project-automation bot moved this from In Progress to Done in MQTTX Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
desktop MQTTX Desktop enhancement New feature or request feature This pr is a feature
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants