The best way to control Claude Code, Codex and more from any computer or phone
fix(web): checking for updates finds provider updates on every machine (#33538)
Co-authored-by: Yuruzuu <tauqmc@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Claude Code <noreply@anthropic.com>
Theo Browne committed
Nov 9, 2026 at 12:36 UTC
e85e0094dd4617a1eada1ad7961f2132a79e67b2
5 files changed
+120
-14
apps/web/src/components/ProviderUpdatesAction.browser.test.tsx
+44
-8
@@ -7,6 +7,7 @@ import {
7
ProviderInstanceId,
8
type ServerProvider,
9
} from "@t3tools/contracts";
10
+import * as Cause from "effect/Cause";
11
import { AsyncResult, Atom } from "effect/reactivity";
12
import { useEffect } from "react";
13
import { expect, it, vi } from "vite-plus/test";
@@ -21,6 +22,8 @@ const state = vi.hoisted(() => ({
22
}[],
23
providers: new Map<EnvironmentId, ReadonlyArray<ServerProvider>>(),
24
requests: [] as EnvironmentId[],
25
+ checks: [] as { environmentId: EnvironmentId; input: unknown }[],
26
+ checkResult: null as AsyncResult.AsyncResult<unknown, unknown> | null,
27
sessions: new Map<EnvironmentId, Atom.Writable<AsyncResult.AsyncResult<AuthSessionState>>>(),
28
}));
29
@@ -41,18 +44,23 @@ vi.mock(import("@t3tools/client-runtime/state/session"), async (original) => {
44
};
45
});
46
vi.mock(import("~/state/server"), () => ({
44
- serverEnvironment: { updateProvider: {} } as never,
47
+ serverEnvironment: { updateProvider: "update", refreshProviders: "refresh" } as never,
48
}));
49
vi.mock(import("~/state/use-atom-command"), () => ({
47
- useAtomCommand: (() =>
48
- async ({ environmentId }: { environmentId: EnvironmentId }) => {
49
- state.requests.push(environmentId);
50
- return AsyncResult.success(undefined);
50
+ useAtomCommand: ((command: string) =>
51
+ async ({ environmentId, input }: { environmentId: EnvironmentId; input: unknown }) => {
52
+ if (command !== "refresh") {
53
+ state.requests.push(environmentId);
54
+ return AsyncResult.success(undefined);
55
+ }
56
+ state.checks.push({ environmentId, input });
57
+ return state.checkResult ?? AsyncResult.success(undefined);
58
}) as never,
59
}));
60
61
import { appAtomRegistry } from "~/rpc/atomRegistry";
55
-import { useProviderUpdates } from "./ProviderUpdatesAction";
62
+import { toastManager } from "./ui/toast";
63
+import { useCheckProviderUpdates, useProviderUpdates } from "./ProviderUpdatesAction";
64
65
const provider: ServerProvider = {
66
instanceId: ProviderInstanceId.make("codex"),
@@ -102,6 +110,8 @@ function setup() {
110
state.environments.map(({ environmentId }) => [environmentId, [provider]]),
111
);
112
state.requests = [];
113
+ state.checks = [];
114
+ state.checkResult = null;
115
const sessions = new Map<EnvironmentId, Atom.Writable<AsyncResult.AsyncResult<AuthSessionState>>>(
116
[
117
[state.environments[0]!.environmentId, Atom.make(session(["orchestration:read"]))],
@@ -118,14 +128,17 @@ function setup() {
128
return { sessions };
129
}
130
121
-it("bulk provider updates exclude connections without a confirmed management grant", async () => {
131
+it("provider updates and checks exclude connections without a confirmed management grant", async () => {
132
const fixture = setup();
133
let updates!: ReturnType<typeof useProviderUpdates>;
134
+ let check!: ReturnType<typeof useCheckProviderUpdates>;
135
function Probe() {
136
const nextUpdates = useProviderUpdates();
137
+ const nextCheck = useCheckProviderUpdates();
138
useEffect(() => {
139
updates = nextUpdates;
128
- }, [nextUpdates]);
140
+ check = nextCheck;
141
+ }, [nextUpdates, nextCheck]);
142
return null;
143
}
144
await using _screen = await render(
@@ -140,6 +153,29 @@ it("bulk provider updates exclude connections without a confirmed management gra
153
await updates.updateAll({ quiet: true });
154
});
155
expect(state.requests).toEqual([writableId]);
156
+ await act(async () => {
157
+ await check();
158
+ });
159
+ // A model refresh always drops the server's cached latest provider versions.
160
+ expect(state.checks).toEqual([{ environmentId: writableId, input: { refreshModels: true } }]);
161
+
162
+ using toast = vi.spyOn(toastManager, "add");
163
+ state.checkResult = AsyncResult.failure(Cause.interrupt());
164
+ await act(async () => {
165
+ await check();
166
+ });
167
+ expect(toast).not.toHaveBeenCalled();
168
+ state.checkResult = AsyncResult.failure(Cause.fail(new Error("offline")));
169
+ await act(async () => {
170
+ await check({ quiet: true });
171
+ });
172
+ expect(toast).not.toHaveBeenCalled();
173
+ await act(async () => {
174
+ await check();
175
+ });
176
+ expect(toast).toHaveBeenCalledWith(
177
+ expect.objectContaining({ title: "Could not check provider updates" }),
178
+ );
179
180
await act(() => {
181
appAtomRegistry.set(fixture.sessions.get(writableId)!, session(["orchestration:read"]));
apps/web/src/components/ProviderUpdatesAction.tsx
+52
-1
@@ -1,5 +1,9 @@
1
import { AuthProvidersManageScope, PROVIDER_DISPLAY_NAMES } from "@t3tools/contracts";
2
-import { settlePromise } from "@t3tools/client-runtime/state/runtime";
2
+import {
3
+ isAtomCommandInterrupted,
4
+ settlePromise,
5
+ squashAtomCommandFailure,
6
+} from "@t3tools/client-runtime/state/runtime";
7
import { useRef, useState } from "react";
8
9
import { useEnvironmentProviders, useEnvironments } from "~/state/environments";
@@ -16,6 +20,53 @@ import { Button } from "./ui/button";
20
import { stackedThreadToast, toastManager } from "./ui/toast";
21
import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip";
22
23
+// `refreshModels` always drops the server's hour-long latest-version cache. `modelCatalogOnly`
24
+// drops it only when the model manifest changed.
25
+export function useCheckProviderUpdates() {
26
+ const { environments } = useEnvironments();
27
+ const manageableIds = useEnvironmentsWithScope(environments, AuthProvidersManageScope);
28
+ const refreshProviders = useAtomCommand(serverEnvironment.refreshProviders, {
29
+ reportFailure: false,
30
+ });
31
+ const inFlight = useRef<Promise<void> | null>(null);
32
+
33
+ const check = async (quiet: boolean) => {
34
+ const failures = await Promise.all(
35
+ environments
36
+ .filter(
37
+ (environment) =>
38
+ environment.connection.phase === "connected" &&
39
+ manageableIds.has(environment.environmentId),
40
+ )
41
+ .map(async ({ environmentId, label }) => {
42
+ const result = await refreshProviders({ environmentId, input: { refreshModels: true } });
43
+ if (result._tag !== "Failure" || isAtomCommandInterrupted(result)) return [];
44
+ const error = squashAtomCommandFailure(result);
45
+ return [`${label}: ${error instanceof Error ? error.message : "Refresh failed."}`];
46
+ }),
47
+ );
48
+ const lines = failures.flat();
49
+ if (quiet || lines.length === 0) return;
50
+ toastManager.add(
51
+ stackedThreadToast({
52
+ type: "error",
53
+ title: "Could not check provider updates",
54
+ description: <span className="whitespace-pre-line">{lines.join("\n")}</span>,
55
+ }),
56
+ );
57
+ };
58
+
59
+ // A repeat click must not start a second model rediscovery while one is running.
60
+ return ({ quiet = false }: { readonly quiet?: boolean } = {}) => {
61
+ if (inFlight.current) return inFlight.current;
62
+ const running = check(quiet).finally(() => {
63
+ inFlight.current = null;
64
+ });
65
+ inFlight.current = running;
66
+ return running;
67
+ };
68
+}
69
+
70
export function useProviderUpdates() {
71
const { environments } = useEnvironments();
72
const manageableIds = useEnvironmentsWithScope(environments, AuthProvidersManageScope);
apps/web/src/components/settings/SettingsPanels.tsx
+3
@@ -110,6 +110,7 @@ import { StorageCleanupSections } from "./StorageSettings";
110
import { UpdateTrackSwitchDialog } from "./UpdateTrackSwitchDialog";
111
import { environmentIdsKey } from "~/state/environmentAtomList";
112
import { environmentSessionStatesAtom } from "~/state/session";
113
+import { useCheckProviderUpdates } from "../ProviderUpdatesAction";
114
import { canUpdateServer } from "../ServerUpdateAction";
115
import { useUpdateEverythingRun } from "../sidebar/updateEverythingRun";
116
import { awaitsTrackSwitch, channelSwitchLabel } from "../sidebar/updateEverything.logic";
@@ -162,6 +163,7 @@ function AboutVersionSection() {
163
);
164
// A second run would replace the first run's progress and local download.
165
const updateRun = useUpdateEverythingRun();
166
+ const checkProviderUpdates = useCheckProviderUpdates();
167
168
const hasDesktopBridge = typeof window !== "undefined" && Boolean(window.desktopBridge);
169
const selectedUpdateChannel = updateState?.channel ?? "latest";
@@ -252,6 +254,7 @@ function AboutVersionSection() {
254
}
255
256
if (typeof bridge.checkForUpdate !== "function") return;
257
+ void checkProviderUpdates();
258
void bridge
259
.checkForUpdate()
260
.then((result) => {
apps/web/src/components/sidebar/SidebarUpdatePill.tsx
+15
-5
@@ -28,6 +28,7 @@ import {
28
shouldToastDesktopUpdateActionResult,
29
} from "../desktopUpdate.logic";
30
import { showDesktopUpdateDownloadedToast } from "../desktopUpdate.toast";
31
+import { useCheckProviderUpdates } from "../ProviderUpdatesAction";
32
import { Alert, AlertDescription, AlertTitle } from "../ui/alert";
33
import { Popover, PopoverCreateHandle, PopoverPopup, PopoverTrigger } from "../ui/popover";
34
import { SidebarMenuItem } from "../ui/sidebar";
@@ -200,6 +201,8 @@ function SidebarUpdateControl() {
201
// The desktop updates this machine, whose policy the primary environment reports.
202
const updatesDenial = managedUpdatesDenial(usePrimaryManagedPolicy());
203
const [isActionPending, setIsActionPending] = useState(false);
204
+ const [providerCheck, setProviderCheck] = useState<"button" | "dialog" | null>(null);
205
+ const isCheckingProviders = providerCheck === "button";
206
const [isConfirmingEverything, setIsConfirmingEverything] = useState(false);
207
const [checkAnimationKey, setCheckAnimationKey] = useState(0);
208
const [releaseNotesPopoverHandle] = useState(() => PopoverCreateHandle());
@@ -230,12 +233,13 @@ function SidebarUpdateControl() {
233
const localUpdateVersion =
234
state && action !== "none" ? getDesktopUpdateDownloadedVersion(state) : null;
235
const everything = useUpdateEverything(localUpdateVersion);
236
+ const checkProviderUpdates = useCheckProviderUpdates();
237
const runsEverything = everything.hasUpdates && !isDownloading;
238
const run = useUpdateEverythingRun();
239
const isRunningEverything = run !== null;
240
const showCheckIcon = shouldShowDesktopUpdateCheckIcon({
241
isAnimationLatched: isCheckAnimationLatched,
238
- isChecking: state?.status === "checking",
242
+ isChecking: state?.status === "checking" || isCheckingProviders,
243
prefersReducedMotion,
244
});
245
const { iconStatus, showUpdateDetails, showUpdateIconState } = resolveSidebarUpdatePresentation({
@@ -283,6 +287,9 @@ function SidebarUpdateControl() {
287
288
if (runsEverything) {
289
setIsConfirmingEverything(true);
290
+ // Machines that still cache an older latest version add their rows while the dialog is open.
291
+ setProviderCheck("dialog");
292
+ void checkProviderUpdates({ quiet: true }).finally(() => setProviderCheck(null));
293
return;
294
}
295
@@ -325,7 +332,7 @@ function SidebarUpdateControl() {
332
setIsCheckAnimationLatched(true);
333
setCheckAnimationKey((key) => key + 1);
334
}
328
- void bridge
335
+ const appCheck = bridge
336
.checkForUpdate()
337
.then((result) => {
338
if (result.checked) return;
@@ -348,8 +355,10 @@ function SidebarUpdateControl() {
355
description: error instanceof Error ? error.message : "Update check failed.",
356
}),
357
);
351
- })
352
- .finally(() => setIsActionPending(false));
358
+ });
359
+ setProviderCheck("button");
360
+ const providersChecked = checkProviderUpdates().finally(() => setProviderCheck(null));
361
+ void Promise.allSettled([appCheck, providersChecked]).then(() => setIsActionPending(false));
362
};
363
364
const runEverything = async () => {
@@ -385,7 +394,7 @@ function SidebarUpdateControl() {
394
const handleCheckAnimationIteration = () => {
395
setIsCheckAnimationLatched(
396
shouldContinueDesktopUpdateCheckAnimation({
388
- isChecking: state?.status === "checking",
397
+ isChecking: state?.status === "checking" || isCheckingProviders,
398
prefersReducedMotion,
399
}),
400
);
@@ -410,6 +419,7 @@ function SidebarUpdateControl() {
419
providerCount={everything.providerCount}
420
rows={everything.rows}
421
restarts={everything.restarts}
422
+ checking={providerCheck === "dialog"}
423
onConfirm={() => void runEverything()}
424
/>
425
);
apps/web/src/components/sidebar/UpdateEverythingDialog.tsx
+6
@@ -55,6 +55,8 @@ interface UpdateEverythingDialogProps {
55
readonly disabledReason?: string | null;
56
/** The confirmed work is starting; it cannot be cancelled from here. */
57
readonly busy?: boolean;
58
+ /** Machines are still looking for provider updates, so more rows can appear. */
59
+ readonly checking?: boolean;
60
}
61
62
type UpdateEverythingDialogContentProps = Omit<
@@ -102,6 +104,7 @@ function UpdateEverythingDialogContent({
104
notes = [],
105
disabledReason = null,
106
busy = false,
107
+ checking = false,
108
}: UpdateEverythingDialogContentProps) {
109
const stopped = useAtomValue(
110
runningThreadCountAtom(
@@ -141,6 +144,9 @@ function UpdateEverythingDialogContent({
144
{providerCount > 0
145
? `${providerCount} provider ${providerCount === 1 ? "update" : "updates"}`
146
: null}
147
+ {checking
148
+ ? `${version !== null || providerCount > 0 ? " · " : ""}Checking for more…`
149
+ : null}
150
</AlertDialogDescription>
151
</AlertDialogHeader>
152
<ScrollArea scrollFade>