Skip to content

Disable model routing for oauth users#11889

Merged
mattKorwel merged 6 commits into
mainfrom
mrcabbage972/routing-auth-disable-2
Oct 28, 2025
Merged

Disable model routing for oauth users#11889
mattKorwel merged 6 commits into
mainfrom
mrcabbage972/routing-auth-disable-2

Conversation

@mrcabbage972

Copy link
Copy Markdown
Contributor

TLDR

Dive Deeper

Reviewer Test Plan

Testing Matrix

🍏 🪟 🐧
npm run
npx
Docker
Podman - -
Seatbelt - -

Linked issues / bugs

@mrcabbage972 mrcabbage972 marked this pull request as ready for review October 23, 2025 23:40
@mrcabbage972 mrcabbage972 requested a review from a team as a code owner October 23, 2025 23:40
@github-actions

github-actions Bot commented Oct 23, 2025

Copy link
Copy Markdown

Size Change: +689 B (0%)

Total Size: 20.2 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 20.2 MB +689 B (0%)
./bundle/sandbox-macos-permissive-closed.sb 1.03 kB 0 B
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-closed.sb 3.29 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B

compressed-size-action

@mrcabbage972

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request introduces a mechanism to disable the model router for specific authentication types, defaulting to disabling it for OAuth users. The configuration changes and associated tests are well-implemented. However, there is a critical issue where the new useModelRouter configuration flag is not used to conditionally bypass the model router, causing it to be invoked on every request. I've left a comment with more details. Addressing this is essential for the feature to function as intended.

Comment on lines +380 to +382
private useModelRouter: boolean;
private readonly initialUseModelRouter: boolean;
private readonly disableModelRouterForAuth?: AuthType[];

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.

critical

These new properties are correctly defined to control model routing based on authentication. However, the useModelRouter flag is not being checked before the model router is invoked in packages/core/src/core/client.ts (specifically in the sendMessageStream method). This means the router is always called, regardless of this configuration, which makes this new feature non-functional.

To fix this, you'll need to add a check for this.config.getUseModelRouter() in client.ts to conditionally bypass the routing logic.

@abhipatel12 abhipatel12 left a comment

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.

LGTM

@mattKorwel mattKorwel added this pull request to the merge queue Oct 28, 2025
@mattKorwel mattKorwel removed this pull request from the merge queue due to a manual request Oct 28, 2025
@mattKorwel mattKorwel merged commit 601a639 into main Oct 28, 2025
21 of 22 checks passed
@mattKorwel mattKorwel deleted the mrcabbage972/routing-auth-disable-2 branch October 28, 2025 22:25
@abhipatel12

Copy link
Copy Markdown
Contributor

/patch preview

@github-actions

Copy link
Copy Markdown

Patch workflow(s) dispatched successfully!

📋 Details:

  • Channels: preview
  • Commit: 601a639f95ee7df4d8c3f09966ce471c5e303b81
  • Workflows Created: 1

🔗 Track Progress:

github-actions Bot pushed a commit that referenced this pull request Oct 28, 2025
Co-authored-by: matt korwel <matt.korwel@gmail.com>
@github-actions

Copy link
Copy Markdown

🚀 Patch PR Created!

📋 Patch Details:

📝 Next Steps:

  1. Review and approve the hotfix PR: #12188
  2. Once merged, the patch release will automatically trigger
  3. You'll receive updates here when the release completes

🔗 Track Progress:

@github-actions

Copy link
Copy Markdown

🚀 Patch Release Started!

📋 Release Details:

  • Environment: prod
  • Channel: preview → publishing to npm tag preview
  • Version: v0.11.0-preview.0
  • Hotfix PR: Merged ✅
  • Release Branch: release/v0.11.0-preview.0-pr-11889

⏳ Status: The patch release is now running. You'll receive another update when it completes.

🔗 Track Progress:

@github-actions

Copy link
Copy Markdown

Patch Release Complete!

📦 Release Details:

🎉 Status: Your patch has been successfully released and published to npm!

📝 What's Available:

🔗 Links:

cocosheng-g pushed a commit that referenced this pull request May 6, 2026
Co-authored-by: matt korwel <matt.korwel@gmail.com>
@sripasg sripasg added the size/m A medium sized PR label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m A medium sized PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants