Skip to content

Conversation

@shariqriazz
Copy link
Contributor

@shariqriazz shariqriazz commented May 23, 2025

Possible fix for #3817

Screenshot 2025-05-23 at 6 45 16 PM

Important

Sets maxTokens to 66000 for google/gemini-2.5-pro-preview in getOpenRouterModels and adds a test for it.

  • Behavior:
    • Sets maxTokens to 66000 for google/gemini-2.5-pro-preview in getOpenRouterModels in openrouter.ts.
  • Tests:
    • Adds test in openrouter.test.ts to verify maxTokens is set to 66000 for google/gemini-2.5-pro-preview.

This description was created by Ellipsis for cbf0fe3. You can customize this summary. It will automatically update as commits are pushed.

model,
modality: architecture?.modality,
maxTokens: id.startsWith("anthropic/") ? top_provider?.max_completion_tokens : 0,
maxTokens: id.startsWith("anthropic/")
Copy link
Contributor

Choose a reason for hiding this comment

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

The nested ternary for maxTokens reduces clarity. Consider extracting the condition (and using a named constant for 66000) to improve maintainability.

@shariqriazz shariqriazz marked this pull request as draft May 23, 2025 13:42
@shariqriazz shariqriazz marked this pull request as ready for review May 23, 2025 13:46
maxTokens: id.startsWith("anthropic/") ? top_provider?.max_completion_tokens : 0,
maxTokens: id.startsWith("anthropic/")
? top_provider?.max_completion_tokens
: id === "google/gemini-2.5-pro-preview"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does openrouter just not include this number? Is that a bug?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

let me check it thoroughly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

after doing some debugging ive hit a wall, the model file we fetch from openrouter does have it as 66k but without this i see 209k and hardcoding is showing 66k correctly. am still trying to figure it out why its happening with gemini or its an issue for all models in openrouter

@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap May 23, 2025
@shariqriazz shariqriazz marked this pull request as draft May 25, 2025 18:35
@shariqriazz
Copy link
Contributor Author

@mrubens its an issue with flash thinking also , i will test some more models tomorrow to see if its just gemini issue or entire openrouter model list

@hannesrudolph hannesrudolph moved this from PR [Needs Review] to TEMP in Roo Code Roadmap May 26, 2025
@daniel-lxs daniel-lxs moved this from TEMP to PR [Draft / In Progress] in Roo Code Roadmap May 27, 2025
@daniel-lxs
Copy link
Member

Hey @shariqriazz, Thank you for your contribution.
I'll be closing this PR as stale temporarily, if you plan on revisiting it please leave a comment on #3817 to have it assigned to you.

@daniel-lxs daniel-lxs closed this Jun 2, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jun 2, 2025
@github-project-automation github-project-automation bot moved this from PR [Draft / In Progress] to Done in Roo Code Roadmap Jun 2, 2025
@shariqriazz shariqriazz deleted the fix/openrouter-gemini-2.5-pro-token-limit branch June 21, 2025 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants