-
Notifications
You must be signed in to change notification settings - Fork 2.7k
fix: custom handler for fetching requesty models #10264
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
fix: custom handler for fetching requesty models #10264
Conversation
Review completed. All previously flagged issues have been addressed.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
The existing flushRouterModels pattern doesn't work for Requesty because it doesn't pass API credentials. This caused the 'Refresh Models' button to return stale cached data instead of fresh models. This fix: - Adds a 'refresh: true' flag to requestRouterModels handler - When refresh=true with a provider filter, flushes cache WITH credentials - Updates Requesty.tsx to use this new pattern instead of flushRouterModels The approach reuses existing infrastructure while ensuring the credential- aware cache flush works for providers like Requesty that require apiKey and baseUrl for API calls. Supersedes #10264
|
We recently merged some changes to be able to pull models from the API on demand and fully authenticated, I opened this PR #10273 to leverage that new functionality to fix the issue with the Requesty button. Thank you for working on this PR and for showing us how to fix it properly. |
Nice that's much cleaner! Thank you :) |
Closes: #10263
Description
Creates 2 custom events (with the same pattern as other provides that need base URL + API key to fetch models).
Test Procedure
You should now see an updated list of models.
Pre-Submission Checklist
Important
Adds custom handler for Requesty models with new events for fetching and refreshing models, updating
Requesty.tsxto use these events.requestRequestyModelsevent inwebviewMessageHandler.tsto fetch and refresh Requesty models usingflushModels()andgetModels().Requesty.tsxto userequestRequestyModelsfor refreshing models on mount and button click.requestyModelstoExtensionMessageandWebviewMessagetypes.Requesty.tsxcomponent now listens forrequestyModelsmessages to update model list.This description was created by
for 2978a3c. You can customize this summary. It will automatically update as commits are pushed.