Disable model routing for oauth users#11889
Conversation
|
Size Change: +689 B (0%) Total Size: 20.2 MB ℹ️ View Unchanged
|
|
/gemini review |
There was a problem hiding this comment.
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.
| private useModelRouter: boolean; | ||
| private readonly initialUseModelRouter: boolean; | ||
| private readonly disableModelRouterForAuth?: AuthType[]; |
There was a problem hiding this comment.
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.
|
/patch preview |
|
✅ Patch workflow(s) dispatched successfully! 📋 Details:
🔗 Track Progress: |
Co-authored-by: matt korwel <matt.korwel@gmail.com>
|
🚀 Patch PR Created! 📋 Patch Details:
📝 Next Steps:
🔗 Track Progress: |
|
🚀 Patch Release Started! 📋 Release Details:
⏳ Status: The patch release is now running. You'll receive another update when it completes. 🔗 Track Progress: |
|
✅ Patch Release Complete! 📦 Release Details:
🎉 Status: Your patch has been successfully released and published to npm! 📝 What's Available:
🔗 Links: |
Co-authored-by: matt korwel <matt.korwel@gmail.com>
TLDR
Dive Deeper
Reviewer Test Plan
Testing Matrix
Linked issues / bugs