@devries-cameron20 / t3code Mirror · read-only / commits / 96d354ae86
Fork 0

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 23, 03:00 UTC

fix(server): tell users how to update an install T3 cannot update (#18110)

Mantas Kantautas committed Oct 18, 2026 at 22:52 UTC 96d354ae862dcaed8dcbdc8f08bb699a97566582
6 files changed +140 -25
apps/web/src/components/ProviderUpdateLaunchNotification.logic.test.ts
+32 -2
@@ -294,8 +294,8 @@ describe("provider update launch notification logic", () => {
294 it("describes settings-only updates without one-click support", () => {
295 const view = getProviderUpdateInitialToastView({
296 updateProviders: [
297 - updateCandidate({ driver: driver("codex"), canUpdate: false }),
298 - updateCandidate({ driver: driver("cursor"), canUpdate: false }),
297 + updateCandidate({ driver: driver("codex") }),
298 + updateCandidate({ driver: driver("cursor") }),
299 ],
300 oneClickProviders: [],
301 });
@@ -303,6 +303,36 @@ describe("provider update launch notification logic", () => {
303 expect(view.description).toBe("Codex and Cursor can be updated from provider settings.");
304 });
305
306 + it("sends installs the server cannot update to the tool that installed them", () => {
307 + const manual = { canUpdate: false, updateCommand: null };
308 + expect(
309 + getProviderUpdateInitialToastView({
310 + updateProviders: [updateCandidate({ driver: driver("codex"), ...manual })],
311 + oneClickProviders: [],
312 + }).description,
313 + ).toBe("Update Codex with the app or tool that installed it.");
314 + expect(
315 + getProviderUpdateInitialToastView({
316 + updateProviders: [
317 + updateCandidate({ driver: driver("codex"), ...manual }),
318 + updateCandidate({ driver: driver("cursor") }),
319 + ],
320 + oneClickProviders: [],
321 + }).description,
322 + ).toBe(
323 + "Cursor can be updated from provider settings. Update Codex with the app or tool that installed it.",
324 + );
325 + const oneClick = updateCandidate({ driver: driver("claudeAgent") });
326 + expect(
327 + getProviderUpdateInitialToastView({
328 + updateProviders: [oneClick, updateCandidate({ driver: driver("codex"), ...manual })],
329 + oneClickProviders: [oneClick],
330 + }).description,
331 + ).toBe(
332 + "Install the update now or review provider settings. Update Codex with the app or tool that installed it.",
333 + );
334 + });
335 +
336 it("uses server update state for running progress", () => {
337 const view = getProviderUpdateProgressToastView({
338 providers: [
apps/web/src/components/ProviderUpdateLaunchNotification.logic.ts
+28 -4
@@ -234,6 +234,33 @@ function formatProviderList(providers: ReadonlyArray<Pick<ServerProvider, "drive
234 return `${names.slice(0, -1).join(", ")}, and ${names[names.length - 1]}`;
235 }
236
237 +/**
238 + * Install and provider settings reach only installs the server can update.
239 + * The rest are updated by the app or tool that installed them, so they get
240 + * their own sentence whatever else the notice offers.
241 + */
242 +function describeInitialUpdates(input: {
243 + readonly updateProviders: ReadonlyArray<ProviderUpdateCandidate>;
244 + readonly oneClickProviders: ReadonlyArray<ProviderUpdateCandidate>;
245 +}): string {
246 + const fromSettings = input.updateProviders.filter(
247 + (provider) => provider.versionAdvisory.canUpdate,
248 + );
249 + const manual = input.updateProviders.filter((provider) => !provider.versionAdvisory.canUpdate);
250 + return [
251 + input.oneClickProviders.length > 0
252 + ? "Install the update now or review provider settings."
253 + : fromSettings.length > 0
254 + ? `${formatProviderList(fromSettings)} can be updated from provider settings.`
255 + : null,
256 + manual.length > 0
257 + ? `Update ${formatProviderList(manual)} with the app or tool that installed ${manual.length === 1 ? "it" : "them"}.`
258 + : null,
259 + ]
260 + .filter((sentence) => sentence !== null)
261 + .join(" ");
262 +}
263 +
264 export function getProviderUpdateInitialToastView(input: {
265 readonly updateProviders: ReadonlyArray<ProviderUpdateCandidate>;
266 readonly oneClickProviders: ReadonlyArray<ProviderUpdateCandidate>;
@@ -242,10 +269,7 @@ export function getProviderUpdateInitialToastView(input: {
269 phase: "initial",
270 type: "warning",
271 title: getProviderUpdateInitialToastTitle(input.updateProviders),
245 - description:
246 - input.oneClickProviders.length > 0
247 - ? "Install the update now or review provider settings."
248 - : `${formatProviderList(input.updateProviders)} can be updated from provider settings.`,
272 + description: describeInitialUpdates(input),
273 };
274 }
275
apps/web/src/components/settings/ProviderInstanceCard.tsx
+1 -1
@@ -907,7 +907,7 @@ export function ProviderInstanceCard({
907 </p>
908 <p
909 className={cn(
910 - "text-xs leading-snug",
910 + "text-xs leading-snug [overflow-wrap:anywhere]",
911 versionAdvisory.emphasis === "strong" ? "text-warning" : "text-muted-foreground",
912 )}
913 >
packages/provider-core/src/server/maintenance.ts
+6
@@ -11,6 +11,12 @@ export interface ProviderMaintenanceCapabilities {
11 */
12 readonly latestVersion?: string | null;
13 readonly compareVersions?: (current: string, latest: string) => number;
14 + /**
15 + * The executable T3 Code runs, symlinks followed, when no update command is
16 + * proven for it. The version advisory names it so the user knows which
17 + * install to update.
18 + */
19 + readonly installPath?: string;
20 }
21
22 export interface ProviderMaintenanceCommandAction {
packages/provider-core/src/server/maintenanceResolver.test.ts
+35 -4
@@ -208,19 +208,44 @@ it.layer(NodeServices.layer)("providerMaintenance", (it) => {
208 });
209 });
210
211 - it("keeps the manual update hint when the install is behind but unowned", () => {
211 + it("names the install to update when it is behind but unowned", () => {
212 expect(
213 createProviderVersionAdvisory({
214 driver: driver("packageTool"),
215 currentVersion: "2.1.110",
216 latestVersion: "2.1.117",
217 - maintenanceCapabilities: manualPackageTool,
217 + maintenanceCapabilities: {
218 + ...manualPackageTool,
219 + installPath: "/Applications/Tool.app/Contents/Resources/bin/package-tool",
220 + },
221 }),
222 ).toMatchObject({
223 status: "behind_latest",
224 latestVersion: "2.1.117",
225 updateCommand: null,
226 canUpdate: false,
227 + message:
228 + "Version 2.1.117 is out. T3 Code runs /Applications/Tool.app/Contents/Resources/bin/package-tool; update it with the app or tool that installed it.",
229 + });
230 + });
231 +
232 + it("offers the update when an owned install is behind", () => {
233 + expect(
234 + createProviderVersionAdvisory({
235 + driver: driver("packageTool"),
236 + currentVersion: "2.1.110",
237 + latestVersion: "2.1.117",
238 + maintenanceCapabilities: makeProviderMaintenanceCapabilities({
239 + provider: driver("packageTool"),
240 + packageName: "@example/package-tool",
241 + updateExecutable: "npm",
242 + updateArgs: ["install", "-g", "@example/package-tool@latest"],
243 + updateLockKey: "npm-global:/usr/local",
244 + }),
245 + }),
246 + ).toMatchObject({
247 + status: "behind_latest",
248 + canUpdate: true,
249 message: "Install the update now or review provider settings.",
250 });
251 });
@@ -898,7 +923,10 @@ it.layer(NodeServices.layer)("providerMaintenance", (it) => {
923 ),
924 );
925
901 - expect(capabilities).toEqual(manualPackageTool);
926 + expect(capabilities).toEqual({
927 + ...manualPackageTool,
928 + installPath: NodeFS.realpathSync(kegBinary),
929 + });
930 }),
931 );
932
@@ -931,7 +959,10 @@ it.layer(NodeServices.layer)("providerMaintenance", (it) => {
959 },
960 ).pipe(Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, noSpawn));
961
934 - expect(capabilities).toEqual(manualPackageTool);
962 + expect(capabilities).toEqual({
963 + ...manualPackageTool,
964 + installPath: NodeFS.realpathSync(customPath),
965 + });
966 }),
967 );
968
packages/provider-core/src/server/maintenanceResolver.ts
+38 -14
@@ -179,14 +179,18 @@ export function makeTargetedProviderUpdateAction(
179 export function makeManualOnlyProviderMaintenanceCapabilities(input: {
180 readonly provider: ProviderDriverKind;
181 readonly packageName: string | null;
182 + readonly installPath?: string;
183 }): ProviderMaintenanceCapabilities {
183 - return makeProviderMaintenanceCapabilities({
184 - provider: input.provider,
185 - packageName: input.packageName,
186 - updateExecutable: null,
187 - updateArgs: [],
188 - updateLockKey: null,
189 - });
184 + return {
185 + ...makeProviderMaintenanceCapabilities({
186 + provider: input.provider,
187 + packageName: input.packageName,
188 + updateExecutable: null,
189 + updateArgs: [],
190 + updateLockKey: null,
191 + }),
192 + ...(input.installPath ? { installPath: input.installPath } : {}),
193 + };
194 }
195
196 export function normalizeCommandPath(commandPath: string): string {
@@ -345,13 +349,17 @@ export const resolvePackageManagedProviderMaintenance = Effect.fn(
349 definition: PackageManagedProviderMaintenanceDefinition,
350 context: ProviderMaintenanceResolutionContext | null,
351 ) {
352 + if (!context) {
353 + return makeManualOnlyProviderMaintenanceCapabilities({
354 + provider: definition.provider,
355 + packageName: definition.npmPackageName,
356 + });
357 + }
358 const manual = makeManualOnlyProviderMaintenanceCapabilities({
359 provider: definition.provider,
360 packageName: definition.npmPackageName,
361 + installPath: context.realCommandPath,
362 });
352 - if (!context) {
353 - return manual;
354 - }
363 const commandPaths = [context.resolvedCommandPath, context.realCommandPath];
364 const packageName = definition.npmPackageName;
365 // WinGet owns these files: `claude update` only reports "managed by winget"
@@ -647,10 +655,20 @@ export const makeCachedProviderMaintenanceResolution = Effect.fn(
655 options?.fresh ? Cache.invalidate(cache, undefined).pipe(Effect.andThen(cached)) : cached;
656 });
657
658 +/**
659 + * An install T3 Code cannot update gets no Update button or command, so its
660 + * message names the version and the executable instead.
661 + */
662 +function manualUpdateMessage(latestVersion: string, installPath: string | undefined): string {
663 + return installPath
664 + ? `Version ${latestVersion} is out. T3 Code runs ${installPath}; update it with the app or tool that installed it.`
665 + : `Version ${latestVersion} is out. Update it with the app or tool that installed it.`;
666 +}
667 +
668 function deriveVersionAdvisory(input: {
669 readonly currentVersion: string | null;
670 readonly latestVersion: string | null;
653 - readonly compareVersions?: (current: string, latest: string) => number;
671 + readonly capabilities: ProviderMaintenanceCapabilities;
672 }): Pick<ServerProviderVersionAdvisory, "status" | "message"> {
673 if (!input.currentVersion) {
674 return { status: "unknown", message: null };
@@ -659,11 +677,17 @@ function deriveVersionAdvisory(input: {
677 return { status: "unknown", message: null };
678 }
679 if (
662 - (input.compareVersions ?? compareSemverVersions)(input.currentVersion, input.latestVersion) < 0
680 + (input.capabilities.compareVersions ?? compareSemverVersions)(
681 + input.currentVersion,
682 + input.latestVersion,
683 + ) < 0
684 ) {
685 return {
686 status: "behind_latest",
666 - message: PROVIDER_UPDATE_ACTION_TOAST_MESSAGE,
687 + message:
688 + input.capabilities.update === null
689 + ? manualUpdateMessage(input.latestVersion, input.capabilities.installPath)
690 + : PROVIDER_UPDATE_ACTION_TOAST_MESSAGE,
691 };
692 }
693 return { status: "current", message: null };
@@ -682,7 +706,7 @@ export function createProviderVersionAdvisory(input: {
706 const advisory = deriveVersionAdvisory({
707 currentVersion: input.currentVersion,
708 latestVersion,
685 - ...(capabilities.compareVersions ? { compareVersions: capabilities.compareVersions } : {}),
709 + capabilities,
710 });
711
712 return {