Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@daniel-lxs
Copy link
Member

@daniel-lxs daniel-lxs commented Dec 22, 2025

Summary

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.

Changes

Backend (webviewMessageHandler.ts)

  • Added a refresh: true flag support to requestRouterModels handler
  • When refresh=true with a provider filter, flushes cache WITH credentials before fetching

Frontend (Requesty.tsx)

  • Updated to use requestRouterModels with refresh: true instead of flushRouterModels
  • Removed unused refetchRouterModels prop since it's no longer needed

Why this is necessary

The flushRouterModels message (used by DeepInfra) calls flushModels({ provider }, true) without credentials. For Requesty, this means getRequestyModels(undefined, undefined) - which fails or returns empty data. The cache isn't cleared on failure, so subsequent refetchRouterModels() returns stale cached data.

This approach reuses existing infrastructure while ensuring the credential-aware cache flush works for providers like Requesty that require apiKey and baseUrl for API calls.

Testing

  • Tested refresh models button with Requesty API key - successfully fetches fresh models
  • All existing tests pass

Supersedes #10264


Important

Enable Requesty model refresh with credentials by adding a refresh flag to requestRouterModels and updating frontend usage.

  • Backend (webviewMessageHandler.ts):
    • Add refresh: true flag support to requestRouterModels handler.
    • Flush cache with credentials when refresh=true and provider filter is set.
  • Frontend (Requesty.tsx):
    • Use requestRouterModels with refresh: true instead of flushRouterModels.
    • Remove unused refetchRouterModels prop.
  • Testing:
    • Verified refresh models button with Requesty API key fetches fresh models.
    • All existing tests pass.

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

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
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Dec 22, 2025
@roomote
Copy link
Contributor

roomote bot commented Dec 22, 2025

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found.

The implementation correctly fixes the Requesty model refresh issue by adding credential support to the requestRouterModels handler. The fix properly addresses the root cause where flushRouterModels was calling the API without credentials, causing Requesty to return stale cached data.

  • Backend: refresh: true flag added to requestRouterModels handler
  • Backend: Cache flush now includes credentials when refresh flag is set
  • Frontend: Updated to use requestRouterModels with refresh: true instead of the two-step flushRouterModels + refetchRouterModels() pattern

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Review] in Roo Code Roadmap Dec 22, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 22, 2025
@daniel-lxs daniel-lxs merged commit 529e0d7 into main Dec 22, 2025
24 checks passed
@daniel-lxs daniel-lxs deleted the fix/requesty-refresh-models-with-credentials branch December 22, 2025 17:43
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Dec 22, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer PR - Needs Review size:S This PR changes 10-29 lines, ignoring generated files.

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants