Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): Codex shadow homes share thread writer locks with the main home #26286

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/26286/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 2 changed files with 72 additions and 2 deletions.

x
0 of 2 viewed, 2 left
40 additions and 0 deletionsapps/server/src/provider/Drivers/CodexHomeLayout.test.tsModified
View file
@@ -121,8 +121,10 @@
'{"models":["shared"]}\n',
yield* writeTextFile(path.join(sharedHome, "auth.json"), '{"shared":true}\n');
+ yield* writeTextFile(path.join(sharedHome, "auth.lock"), "");
yield* fileSystem.makeDirectory(shadowHome, { recursive: true });
yield* writeTextFile(path.join(shadowHome, "auth.json"), '{"shadow":true}\n');
+ yield* writeTextFile(path.join(shadowHome, "auth.lock"), "");
yield* fileSystem.symlink(
path.join(sharedHome, "models_cache.json"),
path.join(shadowHome, "models_cache.json"),
@@ -149,6 +151,9 @@
.readLink(path.join(shadowHome, "auth.json"))
.pipe(Effect.result);
const authContents = yield* fileSystem.readFileString(path.join(shadowHome, "auth.json"));
+ const authLockLinkResult = yield* fileSystem
+ .readLink(path.join(shadowHome, "auth.lock"))
+ .pipe(Effect.result);
​
expect(sessionsTarget).toBe(path.join(sharedHome, "sessions"));
expect(configTarget).toBe(path.join(sharedHome, "config.toml"));
@@ -156,6 +161,7 @@
expect(modelsCacheExists).toBe(false);
expect(authLinkResult._tag).toBe("Failure");
expect(authContents).toContain("shadow");
+ expect(authLockLinkResult._tag).toBe("Failure");
}),