The best way to control Claude Code, Codex and more from any computer or phone
fix(server): Codex no longer offers a one-click update for installs it can't detect (#22504)
Koushik_xd committed
Oct 22, 2026 at 02:37 UTC
c25ba721ae403aacce6974bb1fb044cc65bb1e79
3 files changed
+41
-5
apps/server/src/provider/Drivers/CodexDriver.ts
+1
@@ -76,6 +76,7 @@ function makeCodexMaintenanceResolver(sharedHomePath: string) {
76
nativeUpdate: {
77
args: ["update"],
78
isCommandPath: isCodexStandaloneCommandPath,
79
+ requiresCommandPath: true,
80
env: { CODEX_HOME: sharedHomePath },
81
},
82
});
packages/provider-core/src/server/maintenanceResolver.test.ts
+33
@@ -369,6 +369,39 @@ it.layer(NodeServices.layer)("providerMaintenance", (it) => {
369
}),
370
);
371
372
+ it.effect(
373
+ "keeps an unrecognized install manual-only when the native updater requires its path",
374
+ () =>
375
+ Effect.gen(function* () {
376
+ const systemPath =
377
+ "/usr/local/lib/codex/releases/rust-v0.162.1-x86_64-unknown-linux-musl/bin/codex";
378
+ const capabilities = yield* resolvePackageManagedProviderMaintenance(
379
+ {
380
+ provider: driver("codex"),
381
+ npmPackageName: "@openai/codex",
382
+ nativeUpdate: {
383
+ args: ["update"],
384
+ isCommandPath: isNativeTestCommandPath("/packages/standalone/"),
385
+ requiresCommandPath: true,
386
+ },
387
+ },
388
+ {
389
+ binaryPath: "codex",
390
+ resolvedCommandPath: "/usr/local/bin/codex",
391
+ realCommandPath: systemPath,
392
+ env: {},
393
+ platform: "linux",
394
+ },
395
+ ).pipe(
396
+ Effect.provideService(HostProcess.Platform, "linux"),
397
+ Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, noSpawn),
398
+ );
399
+
400
+ expect(capabilities.update).toBeNull();
401
+ expect(capabilities.installPath).toBe(systemPath);
402
+ }),
403
+ );
404
+
405
const claudeUpdate = {
406
provider: driver("claudeAgent"),
407
npmPackageName: "@anthropic-ai/claude-code",
packages/provider-core/src/server/maintenanceResolver.ts
+7
-5
@@ -85,6 +85,8 @@ export interface PackageManagedProviderMaintenanceDefinition {
85
readonly nativeUpdate: {
86
readonly args: ReadonlyArray<string>;
87
readonly isCommandPath?: (commandPath: string) => boolean;
88
+ /** The updater cannot detect installs outside `isCommandPath`, so leave those manual-only. */
89
+ readonly requiresCommandPath?: boolean;
90
readonly env?: NodeJS.ProcessEnv;
91
} | null;
92
}
@@ -474,11 +476,11 @@ export const resolvePackageManagedProviderMaintenance = Effect.fn(
476
}
477
// A `node_modules` path not proven below belongs to another package or a
478
// project, so the provider's own updater could act on the wrong install.
477
- const fallback = commandPaths.some((commandPath) =>
478
- normalizeCommandPath(commandPath).includes("/node_modules/"),
479
- )
480
- ? manual
481
- : native;
479
+ const fallback =
480
+ nativeUpdate?.requiresCommandPath ||
481
+ commandPaths.some((commandPath) => normalizeCommandPath(commandPath).includes("/node_modules/"))
482
+ ? manual
483
+ : native;
484
if (commandPaths.some(isVitePlusGlobalCommandPath)) {
485
return makeProviderMaintenanceCapabilities({
486
provider: definition.provider,