The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 24, 10:15 UTC
refactor(web): remove obsolete provider update helpers (#10015)
Julius Marminge committed
Sep 5, 2026 at 00:29 UTC
c9b76e6f5d382fb83caafe419f75ead87a3dbabb
2 files changed
-162
apps/web/src/components/ProviderUpdateLaunchNotification.logic.test.ts
-91
@@ -18,17 +18,14 @@ import {
18
environmentGroupsWithUpdates,
19
firstFailedProviderUpdateMessage,
20
firstRejectedProviderUpdateMessage,
21
- firstUnsuccessfulSecondaryProviderOutcome,
21
getProviderUpdateInitialToastView,
22
getProviderUpdateProgressToastView,
23
getProviderUpdateRejectedToastView,
24
getProviderUpdateSidebarPillView,
26
- getSingleProviderUpdateProgressToastView,
25
hasOneClickUpdateProviderCandidate,
26
isProviderUpdateCandidate,
27
isTerminalProviderUpdatePhase,
28
localEnvironmentUpdateNotificationKey,
31
- parseWslDistroFromInstanceId,
29
providerUpdateNotificationKey,
30
resolveEnvironmentUpdateRowStatus,
31
shouldShowPrimaryProviderUpdateToast,
@@ -368,28 +365,6 @@ describe("provider update launch notification logic", () => {
365
});
366
});
367
371
- it("resolves a single-provider completion view from the returned provider snapshot", () => {
372
- const view = getSingleProviderUpdateProgressToastView(
373
- provider({
374
- driver: driver("codex"),
375
- updateState: {
376
- status: "failed",
377
- startedAt: checkedAt,
378
- finishedAt: checkedAt,
379
- message: "command failed",
380
- output: "stderr",
381
- },
382
- }),
383
- );
384
-
385
- expect(view).toMatchObject({
386
- phase: "failed",
387
- type: "error",
388
- title: "Codex v1.1.0 update failed",
389
- description: "command failed",
390
- });
391
- });
392
-
368
it("keeps unchanged providers actionable from settings", () => {
369
const view = getProviderUpdateProgressToastView({
370
providers: [
@@ -444,31 +419,6 @@ describe("provider update launch notification logic", () => {
419
});
420
});
421
447
- it("uses the updated version in the single-provider success toast title", () => {
448
- const view = getSingleProviderUpdateProgressToastView(
449
- provider({
450
- driver: driver("codex"),
451
- version: "1.1.0",
452
- latestVersion: "1.1.0",
453
- advisoryStatus: "current",
454
- updateState: {
455
- status: "succeeded",
456
- startedAt: checkedAt,
457
- finishedAt: checkedAt,
458
- message: "Provider updated.",
459
- output: null,
460
- },
461
- }),
462
- );
463
-
464
- expect(view).toMatchObject({
465
- phase: "succeeded",
466
- type: "success",
467
- title: "Codex updated: v1.1.0",
468
- description: "New sessions will use the updated provider.",
469
- });
470
- });
471
-
422
it("falls back to a rejected RPC message for transport-level failures", () => {
423
const results = [AsyncResult.failure(Cause.die(new Error("WebSocket closed")))];
424
@@ -814,39 +764,6 @@ describe("provider update launch notification logic", () => {
764
expect(snapshots).toEqual([primary]);
765
});
766
817
- it("flags the first unsuccessful secondary outcome, skipping the primary and successes", () => {
818
- const primaryFailed = provider({
819
- driver: driver("codex"),
820
- updateState: terminalState("failed", "primary boom"),
821
- });
822
-
823
- expect(
824
- firstUnsuccessfulSecondaryProviderOutcome([
825
- fulfilledOutcome(true, primaryFailed),
826
- fulfilledOutcome(
827
- false,
828
- provider({
829
- driver: driver("codex"),
830
- updateState: terminalState("succeeded", "ok"),
831
- }),
832
- ),
833
- ]),
834
- ).toBeNull();
835
-
836
- expect(
837
- firstUnsuccessfulSecondaryProviderOutcome([
838
- fulfilledOutcome(true, primaryFailed),
839
- fulfilledOutcome(
840
- false,
841
- provider({
842
- driver: driver("codex"),
843
- updateState: terminalState("failed", "wsl boom"),
844
- }),
845
- ),
846
- ]),
847
- ).toMatchObject({ status: "failed", provider: { updateState: { message: "wsl boom" } } });
848
- });
849
-
767
it("treats a rejected dispatch as not contributing a snapshot", () => {
768
const primary = provider({
769
driver: driver("codex"),
@@ -995,14 +912,6 @@ describe("provider update launch notification logic", () => {
912
}),
913
).toBe("My Device");
914
});
998
-
999
- it("parses the WSL distro from the backend instance id", () => {
1000
- expect(parseWslDistroFromInstanceId("wsl:ubuntu")).toBe("ubuntu");
1001
- expect(parseWslDistroFromInstanceId("wsl:default")).toBeNull();
1002
- expect(parseWslDistroFromInstanceId("wsl:")).toBeNull();
1003
- expect(parseWslDistroFromInstanceId("ssh:host")).toBeNull();
1004
- expect(parseWslDistroFromInstanceId(undefined)).toBeNull();
1005
- });
915
});
916
917
describe("isTerminalProviderUpdatePhase", () => {
apps/web/src/components/ProviderUpdateLaunchNotification.logic.ts
-71
@@ -326,41 +326,6 @@ export function getProviderUpdateProgressToastView(input: {
326
return getProviderUpdateRunningToastView(input.providerCount);
327
}
328
329
-export function getSingleProviderUpdateProgressToastView(
330
- provider: ServerProvider,
331
-): ProviderUpdateToastView {
332
- const view = getProviderUpdateProgressToastView({
333
- providers: [provider],
334
- providerCount: 1,
335
- });
336
- const providerName = PROVIDER_DISPLAY_NAMES[provider.driver] ?? provider.driver;
337
-
338
- switch (view.phase) {
339
- case "running":
340
- return {
341
- ...view,
342
- title: `Updating ${providerName}`,
343
- };
344
- case "failed":
345
- return {
346
- ...view,
347
- title: getProviderFailedUpdateTitle(provider),
348
- };
349
- case "unchanged":
350
- return {
351
- ...view,
352
- title: `${providerName} still needs an update`,
353
- };
354
- case "succeeded":
355
- return {
356
- ...view,
357
- title: getProviderUpdatedTitle(provider),
358
- };
359
- default:
360
- return view;
361
- }
362
-}
363
-
329
export function collectUpdatedProviderSnapshots(input: {
330
readonly results: ReadonlyArray<
331
AtomCommandResult<{ readonly providers: ReadonlyArray<ServerProvider> }, unknown>
@@ -649,42 +614,6 @@ export function collectProviderUpdateOutcomeSnapshots(
614
return [...worstByDriver.values()];
615
}
616
652
-/**
653
- * The first secondary (non-primary) backend whose update resolved without
654
- * succeeding. The primary's own failed/unchanged state is already surfaced
655
- * inline in settings, so only secondaries (which have no inline row) need an
656
- * explicit callout.
657
- */
658
-export function firstUnsuccessfulSecondaryProviderOutcome(
659
- results: ReadonlyArray<PromiseSettledResult<LocalProviderUpdateOutcome>>,
660
-): { readonly provider: ServerProvider; readonly status: "failed" | "unchanged" } | null {
661
- for (const result of results) {
662
- if (result.status !== "fulfilled") {
663
- continue;
664
- }
665
- const outcome = result.value;
666
- if (outcome.isPrimary || outcome.provider === null) {
667
- continue;
668
- }
669
- const status = outcome.provider.updateState?.status;
670
- if (status === "failed" || status === "unchanged") {
671
- return { provider: outcome.provider, status };
672
- }
673
- }
674
- return null;
675
-}
676
-
677
-const WSL_INSTANCE_ID_PREFIX = "wsl:";
678
-
679
-/** The distro name from a WSL backend instance id ("wsl:ubuntu" -> "ubuntu"), or null for the default. */
680
-export function parseWslDistroFromInstanceId(instanceId: string | undefined): string | null {
681
- if (!instanceId || !instanceId.startsWith(WSL_INSTANCE_ID_PREFIX)) {
682
- return null;
683
- }
684
- const distro = instanceId.slice(WSL_INSTANCE_ID_PREFIX.length).trim();
685
- return distro.length === 0 || distro === "default" ? null : distro;
686
-}
687
-
617
/**
618
* A human label that distinguishes local environments by platform (so the
619
* popover shows "Windows" / "WSL" rather than the account name twice). WSL is