Skip to content

Conversation

@Sn0wo2
Copy link

@Sn0wo2 Sn0wo2 commented Nov 18, 2025

Context

add gemini cli 3.0 pro model support

Implementation

google-gemini/gemini-cli@56f9e59

https://ai.google.dev/gemini-api/docs/gemini-3

@changeset-bot
Copy link

changeset-bot bot commented Nov 18, 2025

🦋 Changeset detected

Latest commit: 169fac1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
kilo-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@kevinvandijk
Copy link
Collaborator

Have you seen this working as well? I can't get it to work locally even though I have the cli settings set to include preview features like gemini 3.

@Sn0wo2
Copy link
Author

Sn0wo2 commented Nov 19, 2025

Have you seen this working as well? I can't get it to work locally even though I have the cli settings set to include preview features like gemini 3.

https://github.com/google-gemini/gemini-cli/blob/release/v0.16.0-preview.5/docs/get-started/gemini-3.md
gemini-3.0-pro-preview is not currently in the free tier of the cli...
Unfortunately, I dont have a Google AI Ultra subscriber, but I have submitted an application for gemini 3 pro

> hello                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                  █
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                                                                                                                 │
│ It seems like you don't have access to Gemini 3.                                                                                                                                                                                                │
│ Learn more at https://goo.gle/enable-preview-features                                                                                                                                                                                           │
│ To disable Gemini 3, disable "Preview features" in /settings.                                                                                                                                                                                   │
│                                                                                                                                                                                                                                                 │
│                                                                                                                                                                                                                                                 │
│ ● 1. Switch to gemini-2.5-pro                                                                                                                                                                                                                   │
│   2. Stop                                                                                                                                                                                                                                       │
│                                                                                                                                                                                                                                                 │
│ Note: You can always use /model to select a different option.                                                                                                                                                                                   │
│                                                                                                                                                                                                                                                 │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

@art13eck
Copy link

Screenshot_5 there is no new model :[

@Sn0wo2
Copy link
Author

Sn0wo2 commented Nov 19, 2025

Screenshot_5 there is no new model :[

This PR hasnt been merged yet, so you dont see Gemini CLI 3.0 Pro in the latest version

@Mirrowel
Copy link

This just adds the model - this can't work.
Gemini 3 needs thought signatures stored with the message history and sent back.
You can skip that, but that is just a waste of gemini 3. And it still needs to be coded either way.

@Sn0wo2
Copy link
Author

Sn0wo2 commented Nov 26, 2025

This just adds the model - this can't work. Gemini 3 needs thought signatures stored with the message history and sent back. You can skip that, but that is just a waste of gemini 3. And it still needs to be coded either way.

Its frustrating that Google still doesnt pass my Gemini 3 Pro whitelist, so I cant test it either, and I will close this PR if anyone else plans to add Gemini 3 Pro in cli

@Mirrowel
Copy link

This just adds the model - this can't work. Gemini 3 needs thought signatures stored with the message history and sent back. You can skip that, but that is just a waste of gemini 3. And it still needs to be coded either way.

Its frustrating that Google still doesnt pass my Gemini 3 Pro whitelist, so I cant test it either, and I will close this PR if anyone else plans to add Gemini 3 Pro in cli

I got it in 3 hours after i got my pro for a year. Try submitting again.

@mcowger
Copy link
Contributor

mcowger commented Nov 26, 2025

This PR doesn't work for me.

Confirmed I have 3.0 Preview Access:
Screenshot 2025-11-26 at 12 34 46 PM

Confirmed GeminiCLI works with 2.5 Flash

Screenshot 2025-11-26 at 12 35 37 PM

Switch to pro preview:

Screenshot 2025-11-26 at 12 36 17 PM

@Sn0wo2
Copy link
Author

Sn0wo2 commented Nov 26, 2025

This PR doesn't work for me.

Confirmed I have 3.0 Preview Access: Screenshot 2025-11-26 at 12 34 46 PM

Confirmed GeminiCLI works with 2.5 Flash

Screenshot 2025-11-26 at 12 35 37 PM Switch to pro preview: Screenshot 2025-11-26 at 12 36 17 PM

It is worth mentioning that they added ensureActiveLoopHasThoughtSignatures for preview model google-gemini/gemini-cli@56f9e59

  // To ensure our requests validate, the first function call in every model
  // turn within the active loop must have a `thoughtSignature` property.
  // If we do not do this, we will get back 400 errors from the API.
  ensureActiveLoopHasThoughtSignatures(requestContents: Content[]): Content[] {
    // First, find the start of the active loop by finding the last user turn
    // with a text message, i.e. that is not a function response.
    let activeLoopStartIndex = -1;
    for (let i = requestContents.length - 1; i >= 0; i--) {
      const content = requestContents[i];
      if (content.role === 'user' && content.parts?.some((part) => part.text)) {
        activeLoopStartIndex = i;
        break;
      }
    }

    if (activeLoopStartIndex === -1) {
      return requestContents;
    }

    // Iterate through every message in the active loop, ensuring that the first
    // function call in each message's list of parts has a valid
    // thoughtSignature property. If it does not we replace the function call
    // with a copy that uses the synthetic thought signature.
    const newContents = requestContents.slice(); // Shallow copy the array
    for (let i = activeLoopStartIndex; i < newContents.length; i++) {
      const content = newContents[i];
      if (content.role === 'model' && content.parts) {
        const newParts = content.parts.slice();
        for (let j = 0; j < newParts.length; j++) {
          const part = newParts[j]!;
          if (part.functionCall) {
            if (!part.thoughtSignature) {
              newParts[j] = {
                ...part,
                thoughtSignature: SYNTHETIC_THOUGHT_SIGNATURE,
              };
              newContents[i] = {
                ...content,
                parts: newParts,
              };
            }
            break; // Only consider the first function call
          }
        }
      }
    }
    return newContents;
  }

Since I dont have access to the Gemini 3 Pro CLI at the moment, are there other contributors trying to add this logic to test?

@Mirrowel
Copy link

Mirrowel commented Nov 26, 2025

This is signatures i was talking about. You can easily skip it, but you still need to code the logic to do so.
It's not hard, but kilo's codebase is so massive and compilation problems alone make me not want to go in.

TLDR is you can add "skip_validation_something_something" to every first tool call of every turn to effectively pass the validation, but that will nerf the model's ability.

To do it correctly - you need to store the returne signature each time and send it back in the request(for each first tool call of every message).

UPD: Also, at least in my case, i had to force gemini 3 to send the tool calls correctly. As even with temp 1 and no overrides - it would hallucinate tool parameters. So i am not sure what is done in kilo to go around this, as it was not able to read more than one file at a time, ask followup question correctly, etc. without these changes on my end.

@Sn0wo2
Copy link
Author

Sn0wo2 commented Nov 26, 2025

This is signatures i was talking about. You can easily skip it, but you still need to code the logic to do so. It's not hard, but kilo's codebase is so massive and compilation problems alone make me not want to go in.

TLDR is you can add "skip_validation_something_something" to every first tool call of every turn to effectively pass the validation, but that will nerf the model's ability.

To do it correctly - you need to store the returne signature each time and send it back in the request(for each first tool call of every message).

UPD: Also, at least in my case, i had to force gemini 3 to send the tool calls correctly. As even with temp 1 and no overrides - it would hallucinate tool parameters. So i am not sure what is done in kilo to go around this, as it was not able to read more than one file at a time, ask followup question correctly, etc. without these changes on my end.

Closing this PR for now.
Thanks @Mirrowel and @mcowger for the testing and technical details regarding thoughtSignature.
Since I still haven't received access to the Gemini 3.0 Pro whitelist, I cannot properly debug or verify the necessary logic to handle the thought signatures and validations. As this requires more than just adding the model ID, I'll close this to avoid confusion.
Feel free to pick this up or open a new PR if you have access and the bandwidth to implement the signature logic correctly <3

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants