Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

[codex] Preserve checkpoint repository detection failures (#3360)

Julius Marminge60c9ca0e33dc
diff --git a/apps/server/src/checkpointing/CheckpointStore.test.ts b/apps/server/src/checkpointing/CheckpointStore.test.ts
index 5a6001210..bf332d20d 100644
--- a/apps/server/src/checkpointing/CheckpointStore.test.ts
+++ b/apps/server/src/checkpointing/CheckpointStore.test.ts
@@ -93,6 +93,27 @@ function buildLargeText(lineCount = 5_000): string {
}
it.layer(TestLayer)("CheckpointStore.layer", (it) => {
+ describe("isGitRepository", () => {
+ it.effect("returns false when no Git repository is detected", () =>
+ Effect.gen(function* () {
+ const tmp = yield* makeTmpDir();
+ const checkpointStore = yield* CheckpointStore.CheckpointStore;
+
+ expect(yield* checkpointStore.isGitRepository(tmp)).toBe(false);
+ }),
+ );
+
+ it.effect("returns true when a Git repository is detected", () =>
+ Effect.gen(function* () {
+ const tmp = yield* makeTmpDir();
+ yield* initRepoWithCommit(tmp);
+ const checkpointStore = yield* CheckpointStore.CheckpointStore;
+
+ expect(yield* checkpointStore.isGitRepository(tmp)).toBe(true);
+ }),
+ );
+ });
+
describe("diffCheckpoints", () => {
it.effect("returns full oversized checkpoint diffs without truncation", () =>
Effect.gen(function* () {
diff --git a/apps/server/src/checkpointing/CheckpointStore.ts b/apps/server/src/checkpointing/CheckpointStore.ts
index ed47d5f11..f13aa4572 100644
--- a/apps/server/src/checkpointing/CheckpointStore.ts
+++ b/apps/server/src/checkpointing/CheckpointStore.ts
@@ -115,10 +115,9 @@ export const make = Effect.gen(function* () {
});
const isGitRepository: CheckpointStore["Service"]["isGitRepository"] = (cwd) =>
- vcsRegistry.resolve({ cwd, requestedKind: "git" }).pipe(
- Effect.map(() => true),
- Effect.orElseSucceed(() => false),
- );
+ vcsRegistry
+ .detect({ cwd, requestedKind: "git" })
+ .pipe(Effect.map((repository) => repository !== null));
const captureCheckpoint: CheckpointStore["Service"]["captureCheckpoint"] = Effect.fn(
"captureCheckpoint",