Use the native Codex update command for supported versions #4065
ClosedDestreyf(GitHub profile, opens in a new tab)wants to merge 4 commits into
main fromrefs/pull/4065/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
- apps/server/src/provider/codexMaintenance.ts line 19OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +1,19 @@1+import type { ProviderMaintenanceCapabilities } from "./providerMaintenance.ts";2+import { selectVersionGatedProviderMaintenanceCapabilities } from "./providerMaintenance.ts";3+4+// `codex update` first shipped in a prerelease, but 0.128.0 was the first5+// stable npm release containing it. Keep the stable release as the conservative6+// boundary so older and indeterminate installations retain path-based updates.7+export const CODEX_NATIVE_UPDATE_MINIMUM_VERSION = "0.128.0";8+9+export function selectCodexProviderMaintenanceCapabilities(input: {10+ readonly installedVersion: string | null | undefined;11+ readonly legacyCapabilities: ProviderMaintenanceCapabilities;12+ readonly environment?: NodeJS.ProcessEnv;13+}): ProviderMaintenanceCapabilities {14+ return selectVersionGatedProviderMaintenanceCapabilities({15+ currentVersion: input.installedVersion,16+ minimumVersion: CODEX_NATIVE_UPDATE_MINIMUM_VERSION,17+ legacyCapabilities: input.legacyCapabilities,18+ nativeUpdate: {19+ executable: "codex",
Destreyf(GitHub profile, opens in a new tab) changed the title
- apps/server/src/provider/codexMaintenance.ts line 57Resolvedby Destreyf(GitHub profile, opens in a new tab)@@ -0,0 +1,18 @@1+import type { ProviderMaintenanceCapabilities } from "./providerMaintenance.ts";2+import { selectVersionGatedProviderMaintenanceCapabilities } from "./providerMaintenance.ts";3+4+// `codex update` first shipped in a prerelease, but 0.128.0 was the first5+// stable npm release containing it. Keep the stable release as the conservative6+// boundary so older and indeterminate installations retain path-based updates.7+export const CODEX_NATIVE_UPDATE_MINIMUM_VERSION = "0.128.0";8+9+export function selectCodexProviderMaintenanceCapabilities(input: {10+ readonly installedVersion: string | null | undefined;11+ readonly legacyCapabilities: ProviderMaintenanceCapabilities;12+ readonly executable: string;13+ readonly environment?: NodeJS.ProcessEnv;14+}): ProviderMaintenanceCapabilities {15+ return selectVersionGatedProviderMaintenanceCapabilities({16+ currentVersion: input.installedVersion,17+ minimumVersion: CODEX_NATIVE_UPDATE_MINIMUM_VERSION,18+ legacyCapabilities: input.legacyCapabilities,apps/server/src/provider/Drivers/CodexDriver.ts line 157OutdatedResolvedby Destreyf(GitHub profile, opens in a new tab)@@ -144,7 +145,13 @@144145 enabled,145146 homePath: homeLayout.effectiveHomePath ?? "",146147 } satisfies CodexSettings;147- const maintenanceCapabilities = yield* resolveProviderMaintenanceCapabilitiesEffect(UPDATE, {148- binaryPath: effectiveConfig.binaryPath,149- env: processEnv,150- });148+ const legacyMaintenanceCapabilities = yield* resolveProviderMaintenanceCapabilitiesEffect(149+ UPDATE,150+ {151+ binaryPath: effectiveConfig.binaryPath,152+ env: processEnv,153+ },154+ );155+ const maintenanceEnvironment = {156+ ...processEnv,157+ ...(effectiveConfig.homePath ? { CODEX_HOME: effectiveConfig.homePath } : {}),apps/server/src/provider/codexMaintenance.ts line 22OutdatedResolvedby Destreyf(GitHub profile, opens in a new tab)@@ -0,0 +2,21 @@2+import { selectVersionGatedProviderMaintenanceCapabilities } from "./providerMaintenance.ts";3+4+// `codex update` first shipped in a prerelease, but 0.128.0 was the first5+// stable npm release containing it. Keep the stable release as the conservative6+// boundary so older and indeterminate installations retain path-based updates.7+export const CODEX_NATIVE_UPDATE_MINIMUM_VERSION = "0.128.0";8+9+export function selectCodexProviderMaintenanceCapabilities(input: {10+ readonly installedVersion: string | null | undefined;11+ readonly legacyCapabilities: ProviderMaintenanceCapabilities;12+ readonly executable: string;13+ readonly environment?: NodeJS.ProcessEnv;14+}): ProviderMaintenanceCapabilities {15+ return selectVersionGatedProviderMaintenanceCapabilities({16+ currentVersion: input.installedVersion,17+ minimumVersion: CODEX_NATIVE_UPDATE_MINIMUM_VERSION,18+ legacyCapabilities: input.legacyCapabilities,19+ nativeUpdate: {20+ executable: input.executable,21+ args: ["update"],22+ lockKey: "codex-native",
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- apps/server/src/provider/Drivers/CodexDriver.ts lines 162 to 168Resolvedby Destreyf(GitHub profile, opens in a new tab)@@ -144,7 +148,17 @@144148 enabled,145149 homePath: homeLayout.effectiveHomePath ?? "",146150 } satisfies CodexSettings;147- const maintenanceCapabilities = yield* resolveProviderMaintenanceCapabilitiesEffect(UPDATE, {148- binaryPath: effectiveConfig.binaryPath,149- env: processEnv,151+ const maintenanceResolution = yield* resolveProviderMaintenanceCapabilitiesWithPathsEffect(152+ UPDATE,153+ {154+ binaryPath: effectiveConfig.binaryPath,155+ env: processEnv,156+ },157+ );158+ const legacyMaintenanceCapabilities = maintenanceResolution.capabilities;159+ const maintenanceEnvironment = makeCodexMaintenanceEnvironment({160+ environment: processEnv,161+ realExecutablePath:162+ maintenanceResolution.realCommandPath ?? maintenanceResolution.resolvedCommandPath,163+ sharedHomePath: homeLayout.sharedHomePath,150164 });
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed