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

Co-authored-by: codex <[email protected]>
This commit is contained in:
Julius Marmingeandcodex authored and GitHub committed 2026-06-20 15:55:44 -07:00
1 parent ad2cb1dd57
commit 60c9ca0e33
2 files changed
+24 -4

No files matched your search

@@ -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* () {
@@ -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",