-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat(config): migrate global rate limit to profile-specific settings #1720
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
feat(config): migrate global rate limit to profile-specific settings #1720
Conversation
This commit introduces a new method to migrate the global rate limit setting to individual API configurations. The `migrateRateLimitToProfiles` method updates all existing configurations with the global rate limit value and removes the global setting. Additionally, the rate limit is now part of the API configuration, allowing for more granular control. - Added migration logic in `ConfigManager`. - Updated `ClineProvider` to handle rate limit updates. - Adjusted related components to accommodate the new rate limit structure. Tests have been added to ensure the migration works correctly and handles edge cases.
|
| alwaysApproveResubmit, | ||
| requestDelaySeconds, | ||
| rateLimitSeconds, | ||
| // rateLimitSeconds is now part of apiConfiguration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // rateLimitSeconds is now part of apiConfiguration |
| alwaysApproveResubmit: alwaysApproveResubmit ?? false, | ||
| requestDelaySeconds: requestDelaySeconds ?? 10, | ||
| rateLimitSeconds: rateLimitSeconds ?? 0, | ||
| rateLimitSeconds: apiConfiguration.rateLimitSeconds ?? 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this?
| alwaysApproveResubmit: stateValues.alwaysApproveResubmit ?? false, | ||
| requestDelaySeconds: Math.max(5, stateValues.requestDelaySeconds ?? 10), | ||
| rateLimitSeconds: stateValues.rateLimitSeconds ?? 0, | ||
| // rateLimitSeconds is now part of the API configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // rateLimitSeconds is now part of the API configuration |
| export type ApiConfiguration = ApiHandlerOptions & { | ||
| apiProvider?: ApiProvider | ||
| id?: string // stable unique identifier | ||
| rateLimitSeconds?: number // Rate limit in seconds between API requests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to add this here
|
|
||
| type AdvancedSettingsProps = HTMLAttributes<HTMLDivElement> & { | ||
| rateLimitSeconds: number | ||
| rateLimitSeconds?: number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should move this out of the advanced settings and move it up near the model temperature so it's clear that it's linked to the profile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'm going to place it below the temperature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks!
This commit introduces a new method to migrate the global rate limit setting to individual Profiles configurations. The
migrateRateLimitToProfilesmethod updates all existing configurations with the global rate limit value and removes the global setting. Additionally, the rate limit is now part of the Profile configuration, allowing for more granular control.ConfigManager.ClineProviderto handle rate limit updates.Tests have been added to ensure the migration works correctly and handles edge cases.
Important
Migrates global rate limit to profile-specific settings, updating configuration management and UI components accordingly.
migrateRateLimitToProfiles()inConfigManager.globalState.ClineProviderto handle rate limit per profile.AdvancedSettings.tsxto userateLimitSecondsfrom profile settings.SettingsView.tsxto handlerateLimitSecondschanges.migrateRateLimitToProfiles()inConfigManager.test.tsto ensure correct migration and error handling.This description was created by
for b4a1506. It will automatically update as commits are pushed.