Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit 59b6c55

Browse files
committed
fix: invalidate router models cache after Poe refresh
After clicking Refresh Models, the ModelPicker dropdown (powered by ExtensionStateContext) updated correctly, but the model validation in ApiOptions still used a stale react-query cache. This caused newly fetched models like gpt-5.4 to show "not available" even though they appeared in the picker. Invalidate the react-query ["routerModels"] cache on successful Poe refresh so validation sees the same model list as the dropdown. Also bumps ai-sdk-provider-poe to ^2.0.17.
1 parent 089cfa4 commit 59b6c55

4 files changed

Lines changed: 15 additions & 10 deletions

File tree

packages/types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"clean": "rimraf dist .turbo"
2424
},
2525
"dependencies": {
26-
"ai-sdk-provider-poe": "^2.0.16",
26+
"ai-sdk-provider-poe": "^2.0.17",
2727
"zod": "3.25.76"
2828
},
2929
"devDependencies": {

pnpm-lock.yaml

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@
471471
"@roo-code/telemetry": "workspace:^",
472472
"@roo-code/types": "workspace:^",
473473
"@vscode/codicons": "^0.0.36",
474-
"ai-sdk-provider-poe": "^2.0.16",
474+
"ai-sdk-provider-poe": "^2.0.17",
475475
"async-mutex": "^0.5.0",
476476
"axios": "^1.12.0",
477477
"cheerio": "^1.0.0",

webview-ui/src/components/settings/providers/Poe.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useCallback, useState, useEffect, useRef } from "react"
22
import { VSCodeTextField } from "@vscode/webview-ui-toolkit/react"
3+
import { useQueryClient } from "@tanstack/react-query"
34

45
import {
56
type ProviderSettings,
@@ -37,6 +38,7 @@ export const Poe = ({
3738
simplifySettings,
3839
}: PoeProps) => {
3940
const { t } = useAppTranslation()
41+
const queryClient = useQueryClient()
4042
const { routerModels } = useExtensionState()
4143
const [refreshStatus, setRefreshStatus] = useState<"idle" | "loading" | "success" | "error">("idle")
4244
const [refreshError, setRefreshError] = useState<string | undefined>()
@@ -56,6 +58,9 @@ export const Poe = ({
5658
if (refreshStatus === "loading") {
5759
if (!poeErrorJustReceived.current) {
5860
setRefreshStatus("success")
61+
// Invalidate the react-query router models cache so
62+
// validation in ApiOptions picks up the refreshed list.
63+
queryClient.invalidateQueries({ queryKey: ["routerModels"] })
5964
}
6065
}
6166
}
@@ -65,7 +70,7 @@ export const Poe = ({
6570
return () => {
6671
window.removeEventListener("message", handleMessage)
6772
}
68-
}, [refreshStatus])
73+
}, [refreshStatus, queryClient])
6974

7075
const handleInputChange = useCallback(
7176
<K extends keyof ProviderSettings, E>(

0 commit comments

Comments
 (0)