Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): keep new Codex SQLite state shadow-local #7201

Closedmatsvarn(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/7201/headopened View on GitHub

Showing 2 changed files with 113 additions and 6 deletions.

x
0 of 2 viewed, 2 left
65 additions and 0 deletionsapps/server/src/provider/Drivers/CodexHomeLayout.test.tsModified
View file
@@ -210,6 +210,57 @@
}),
​
+ it.effect("keeps a SQLite family local when Codex creates it between passes", () =>
+ Effect.gen(function* () {
+ const fileSystem = yield* FileSystem.FileSystem;
+ const path = yield* Path.Path;
+ const sharedHome = yield* makeTempDir("t3code-codex-shared-");
+ const shadowRoot = yield* makeTempDir("t3code-codex-shadow-root-");
+ const shadowHome = path.join(shadowRoot, "shadow");
+ const layout = yield* resolveCodexHomeLayout(
+ decodeCodexSettings({
+ homePath: sharedHome,
+ shadowHomePath: shadowHome,
+ }),
+ );
+​
+ yield* materializeCodexShadowHome(layout);
+​
+ for (const suffix of ["", "-wal", "-shm"]) {
+ yield* writeTextFile(path.join(sharedHome, `queue_1.sqlite${suffix}`), `shared${suffix}`);
+ yield* writeTextFile(path.join(shadowHome, `queue_1.sqlite${suffix}`), `shadow${suffix}`);
+ yield* writeTextFile(
+ path.join(sharedHome, `future_runtime.sqlite${suffix}`),
+ `future-shared${suffix}`,
+ );
+ }
+ yield* writeTextFile(path.join(shadowHome, "future_runtime.sqlite"), "future-shadow");
+​