mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
ui(router-models): guard subscription to only resolve matching provider filter to avoid race with active-only payload (pairs with #8916 backend filtering)
This commit is contained in:
parent
dcdd631587
commit
1ff5392fb1
1 changed files with 12 additions and 0 deletions
|
|
@ -28,6 +28,18 @@ const getRouterModels = async (providers?: string[]) =>
|
|||
const message: ExtensionMessage = event.data
|
||||
|
||||
if (message.type === "routerModels") {
|
||||
const msgProviders = message?.values?.providers as string[] | undefined
|
||||
const requestedKey = providers && providers.length > 0 ? providers.slice().sort().join(",") : "all"
|
||||
const responseKey =
|
||||
Array.isArray(msgProviders) && msgProviders.length > 0
|
||||
? msgProviders.slice().sort().join(",")
|
||||
: "all"
|
||||
|
||||
if (requestedKey !== responseKey) {
|
||||
// Not our response; ignore and wait for the matching one
|
||||
return
|
||||
}
|
||||
|
||||
clearTimeout(timeout)
|
||||
cleanup()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue