Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): update shared Codex installs from their owning home #25235

Mergedmaria-rcksmerged 1 commit intomain fromrefs/pull/25235/headmerged by maria-rcks View on GitHub

Showing 3 changed files with 129 additions and 8 deletions.

x
0 of 3 viewed, 3 left
101 additions and 0 deletionsapps/server/src/provider/Drivers/CodexDriver.test.tsModified
View file
@@ -377,6 +377,107 @@
​
+ it.effect.skipIf(windowsHost)(
+ "runs the standalone updater against the home that holds a shared install",
+ () =>
+ Effect.gen(function* () {
+ const fs = yield* FileSystem.FileSystem;
+ const tempDir = yield* fs
+ .makeTempDirectoryScoped({ prefix: "t3-codex-driver-" })
+ .pipe(Effect.flatMap((directory) => fs.realPath(directory)));
+ // One standalone install, linked onto PATH and used by two account homes.
+ // `İ` gets longer when lowercased, so the home must not be sliced from a
+ // lowercased copy of the path.
+ const installHome = NodePath.join(tempDir, "codex-İnstall");
+ const realBinaryPath = NodePath.join(
+ installHome,
+ "packages",
+ "standalone",
+ "releases",
+ "0.162.1-x86_64-unknown-linux-musl",
+ "bin",
+ "codex",
+ );
+ const binaryPath = NodePath.join(tempDir, "bin", "codex");
+ yield* fs.makeDirectory(NodePath.dirname(realBinaryPath), { recursive: true });
+ yield* fs.makeDirectory(NodePath.dirname(binaryPath), { recursive: true });
+ yield* fs.writeFileString(realBinaryPath, "#!/bin/sh\n");
+ yield* fs.chmod(realBinaryPath, 0o755);