@devries-cameron20 / t3code Mirror · read-only / commits / 4461b84a9d
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 22, 05:45 UTC

fix(server): review keeps tracked changes when untracked files overflow the listing (#29615)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Alex Southwell committed Nov 3, 2026 at 23:22 UTC 4461b84a9df39758ecc664fb9ff8fccda8c1bac8
2 files changed +33 -31
apps/server/src/vcs/GitVcsDriverCore.test.ts
+32 -25
@@ -2545,33 +2545,40 @@ it.layer(layerTest)("GitVcsDriver core integration", (it) => {
2545 }),
2546 );
2547
2548 - it.effect("keeps tracked changes visible when untracked discovery fails", () =>
2549 - Effect.gen(function* () {
2550 - const delegate = yield* ChildProcessSpawner.ChildProcessSpawner;
2551 - const failingLsFilesSpawner = ChildProcessSpawner.make((command) => {
2552 - if (!ChildProcess.isStandardCommand(command)) {
2553 - return Effect.die("expected a standard Git command");
2554 - }
2555 - return command.args[0] === "ls-files" && command.args[1] === "--others"
2556 - ? Effect.succeed(makeNonRepositoryHandle())
2557 - : delegate.spawn(command);
2558 - });
2559 - const driver = yield* makeGitVcsDriverCore().pipe(
2560 - Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, failingLsFilesSpawner),
2561 - Effect.provide(layerServerConfig),
2562 - );
2563 - const cwd = yield* makeTmpDir();
2564 - yield* initRepoWithCommit(cwd).pipe(
2565 - Effect.provideService(GitVcsDriver.GitVcsDriver, driver),
2566 - );
2567 - yield* writeTextFile(cwd, "README.md", "# tracked change\n");
2548 + it.effect.each(["fails", "exceeds the output limit"] as const)(
2549 + "keeps tracked changes visible when untracked discovery %s",
2550 + (scenario) =>
2551 + Effect.gen(function* () {
2552 + const delegate = yield* ChildProcessSpawner.ChildProcessSpawner;
2553 + const failingLsFilesSpawner = ChildProcessSpawner.make((command) => {
2554 + if (!ChildProcess.isStandardCommand(command)) {
2555 + return Effect.die("expected a standard Git command");
2556 + }
2557 + if (command.args[0] !== "ls-files" || command.args[1] !== "--others") {
2558 + return delegate.spawn(command);
2559 + }
2560 + return Effect.succeed(
2561 + scenario === "fails"
2562 + ? makeNonRepositoryHandle()
2563 + : makeSuccessfulHandle("a".repeat(16 * 1024 * 1024 + 1)),
2564 + );
2565 + });
2566 + const driver = yield* makeGitVcsDriverCore().pipe(
2567 + Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, failingLsFilesSpawner),
2568 + Effect.provide(layerServerConfig),
2569 + );
2570 + const cwd = yield* makeTmpDir();
2571 + yield* initRepoWithCommit(cwd).pipe(
2572 + Effect.provideService(GitVcsDriver.GitVcsDriver, driver),
2573 + );
2574 + yield* writeTextFile(cwd, "README.md", "# tracked change\n");
2575
2569 - const preview = yield* driver.getReviewDiffPreview({ cwd, ignoreWhitespace: false });
2570 - const diff = preview.sources.find((source) => source.kind === "working-tree")?.diff ?? "";
2576 + const preview = yield* driver.getReviewDiffPreview({ cwd, ignoreWhitespace: false });
2577 + const diff = preview.sources.find((source) => source.kind === "working-tree")?.diff ?? "";
2578
2572 - assert.include(diff, "-# test");
2573 - assert.include(diff, "+# tracked change");
2574 - }),
2579 + assert.include(diff, "-# test");
2580 + assert.include(diff, "+# tracked change");
2581 + }),
2582 );
2583
2584 it.effect.each([
apps/server/src/vcs/GitVcsDriverCore.ts
+1 -6
@@ -3118,12 +3118,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
3118 cwd,
3119 ["ls-files", "--others", "--exclude-standard", "-z", "--", ...pathArgs],
3120 { maxOutputBytes: REVIEW_METADATA_MAX_OUTPUT_BYTES },
3121 - ).pipe(
3122 - Effect.catchIf(
3123 - (error) => error.outputLength === undefined,
3124 - () => Effect.succeed(null),
3125 - ),
3126 - );
3121 + ).pipe(Effect.orElseSucceed(() => null));
3122 if (untracked === null) return null;
3123 const paths = splitNullSeparatedGitStdoutPaths(untracked).filter(
3124 (candidate) => onlyPath === undefined || candidate === onlyPath,