@devries-cameron20 / t3code Mirror · read-only / commits / 70e3174b77
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 23, 04:15 UTC

fix(codex): Finder metadata no longer blocks shadow-home setup (#18991)

ABDUL RAHMAN JAMSHID NASSER AL RASHDI committed Oct 18, 2026 at 23:11 UTC 70e3174b770d54173557bf8c5e9fab390d064921
2 files changed +41 -1
apps/server/src/provider/Drivers/CodexHomeLayout.test.ts
+39
@@ -85,6 +85,45 @@ it.layer(NodeServices.layer)("CodexHomeLayout", (it) => {
85 });
86
87 describe("materializeCodexShadowHome", () => {
88 + it.effect.skipIf(!symlinksSupported)(
89 + "keeps Finder metadata local across repeated shadow home setup",
90 + () =>
91 + Effect.gen(function* () {
92 + const fileSystem = yield* FileSystem.FileSystem;
93 + const path = yield* Path.Path;
94 + const sharedHome = yield* makeTempDir("t3code-codex-shared-");
95 + const shadowHome = yield* makeTempDir("t3code-codex-shadow-");
96 + const sharedMetadata = path.join(sharedHome, ".DS_Store");
97 + const shadowMetadata = path.join(shadowHome, ".DS_Store");
98 +
99 + yield* writeTextFile(sharedMetadata, "shared Finder metadata");
100 + yield* writeTextFile(shadowMetadata, "shadow Finder metadata");
101 + yield* writeTextFile(path.join(shadowHome, "auth.json"), '{"shadow":true}\n');
102 + const layout = yield* resolveCodexHomeLayout(
103 + decodeCodexSettings({ homePath: sharedHome, shadowHomePath: shadowHome }),
104 + );
105 +
106 + yield* materializeCodexShadowHome(layout);
107 + expect(yield* fileSystem.readFileString(shadowMetadata)).toBe("shadow Finder metadata");
108 + yield* fileSystem.remove(shadowMetadata);
109 + yield* materializeCodexShadowHome(layout);
110 + expect(yield* fileSystem.exists(shadowMetadata)).toBe(false);
111 +
112 + yield* writeTextFile(shadowMetadata, "shadow Finder metadata");
113 + yield* materializeCodexShadowHome(layout);
114 + yield* materializeCodexShadowHome(layout);
115 +
116 + expect(yield* fileSystem.readFileString(sharedMetadata)).toBe("shared Finder metadata");
117 + expect(yield* fileSystem.readFileString(shadowMetadata)).toBe("shadow Finder metadata");
118 + expect(yield* fileSystem.readFileString(path.join(shadowHome, "auth.json"))).toBe(
119 + '{"shadow":true}\n',
120 + );
121 + expect(yield* fileSystem.readLink(path.join(shadowHome, "sessions"))).toBe(
122 + path.join(sharedHome, "sessions"),
123 + );
124 + }),
125 + );
126 +
127 it.effect.skipIf(!symlinksSupported)(
128 "materializes a shadow home with shared state links and private auth",
129 () =>
apps/server/src/provider/Drivers/CodexHomeLayout.ts
+2 -1
@@ -29,7 +29,8 @@ const KNOWN_SHARED_DIRECTORIES = [
29 ] as const;
30
31 const PRIVATE_ENTRY_NAMES = new Set(["auth.json", "models_cache.json"]);
32 -const SHADOW_LOCAL_ENTRY_NAMES = new Set(["log", "memories", "tmp"]);
32 +// Finder maintains metadata separately for each directory, including shadow homes.
33 +const SHADOW_LOCAL_ENTRY_NAMES = new Set(["log", "memories", "tmp", ".DS_Store"]);
34 // Codex creates these runtime locks itself when it starts in a shadow home before the shared
35 // home has one. They guard shared state, so a local copy is replaced with the shared link.
36 const REPLACEABLE_SHARED_RUNTIME_ENTRIES = new Set(["mcp-oauth-locks", ".sqlite-maintenance.lock"]);