Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): update standalone Codex installs with codex update #5630

Closedhkarlsen06(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/5630/headopened View on GitHub

Showing 4 changed files with 148 additions and 5 deletions (loading 1).

x
0 of 4 viewed, 4 left
23 additions and 1 deletionapps/server/src/provider/Drivers/CodexDriver.tsModified
View file
@@ -45,6 +45,7 @@
import {
enrichProviderSnapshotWithVersionAdvisory,
makePackageManagedProviderMaintenanceResolver,
+ normalizeCommandPath,
resolveProviderMaintenanceCapabilitiesEffect,
} from "../providerMaintenance.ts";
import {
@@ -60,11 +61,32 @@
const decodeCodexSettings = Schema.decodeSync(CodexSettings);
​
const DRIVER_KIND = ProviderDriverKind.make("codex");
+​
+/**
+ * Codex's standalone installer drops a `~/.local/bin/codex` symlink pointing
+ * into a versioned release under `~/.codex/packages/standalone/`. Such an
+ * install is owned by `codex update`, not by any package manager, so it is
+ * matched here rather than falling through to the npm-global default.
+ */
+export function isCodexNativeCommandPath(commandPath: string): boolean {
+ const normalized = normalizeCommandPath(commandPath);
+ return (
+ normalized.endsWith("/.local/bin/codex") ||
+ normalized.endsWith("/.local/bin/codex.exe") ||
+ normalized.includes("/.codex/packages/standalone/")
+ );
+}
+​
const UPDATE = makePackageManagedProviderMaintenanceResolver({