@devries-cameron20 / t3code-1 / commits / dcbe9a6f89
Fork 0

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

fix(server): tracked clones keep an explicit SSH protocol on fallback and Retry (#28365)

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

Victor Vogel committed Nov 1, 2026 at 16:04 UTC dcbe9a6f890ab3b3335e5250af98095816749b84
2 files changed +14 -6
apps/server/src/project/ProjectCloneTracker.test.ts
+6 -5
@@ -4,6 +4,7 @@ import {
4 OrchestrationDispatchCommandError,
5 ProjectId,
6 projectCloneProgressSummary,
7 + type SourceControlCloneProtocol,
8 SourceControlRepositoryError,
9 } from "@t3tools/contracts";
10 import * as Deferred from "effect/Deferred";
@@ -146,12 +147,12 @@ describe("ProjectCloneTracker", () => {
147 });
148
149 it.effect("keeps a failed clone with git's own explanation and retries it", () => {
149 - let attempts = 0;
150 + const protocols: Array<SourceControlCloneProtocol | undefined> = [];
151 const harness = makeHarness({
152 clone: (input) =>
153 Effect.suspend(() => {
153 - attempts += 1;
154 - return attempts === 1
154 + protocols.push(input.protocol);
155 + return protocols.length === 1
156 ? Effect.fail(
157 new SourceControlRepositoryError({
158 operation: "cloneRepository",
@@ -168,7 +169,7 @@ describe("ProjectCloneTracker", () => {
169 });
170 return Effect.gen(function* () {
171 const tracker = yield* ProjectCloneTracker.ProjectCloneTracker;
171 - yield* tracker.start(startInput, harness.hooks);
172 + yield* tracker.start({ ...startInput, protocol: "ssh" }, harness.hooks);
173 yield* Effect.yieldNow;
174 const failed = yield* tracker.get(projectId);
175 expect(failed).toMatchObject({ phase: "failed", error: "fatal: repository not found" });
@@ -177,7 +178,7 @@ describe("ProjectCloneTracker", () => {
178 expect(harness.discarded).toEqual(["/workspace/t3code"]);
179 yield* Effect.yieldNow;
180 expect((yield* tracker.get(projectId))?.phase).toBe("done");
180 - expect(attempts).toBe(2);
181 + expect(protocols).toEqual(["ssh", "ssh"]);
182 }).pipe(Effect.provide(harness.layer));
183 });
184
apps/server/src/project/ProjectCloneTracker.ts
+8 -1
@@ -5,6 +5,7 @@ import type {
5 ProjectCloneStartInput,
6 ProjectCloneStartResult,
7 ProjectId,
8 + SourceControlCloneProtocol,
9 SourceControlRepositoryInfo,
10 } from "@t3tools/contracts";
11 import {
@@ -85,6 +86,7 @@ interface TrackedClone {
86 readonly cloneUrl: string;
87 readonly destinationPath: string;
88 readonly repository: SourceControlRepositoryInfo | null;
89 + readonly protocol: SourceControlCloneProtocol;
90 };
91 }
92
@@ -216,7 +218,11 @@ export const make = Effect.gen(function* () {
218 const pulses = yield* Queue.sliding<void>(1);
219 yield* watchForStall(projectId, pulses).pipe(Effect.forkScoped);
220 return yield* repositories.cloneRepository(
219 - { remoteUrl: tracked.input.cloneUrl, destinationPath: tracked.input.destinationPath },
221 + {
222 + remoteUrl: tracked.input.cloneUrl,
223 + destinationPath: tracked.input.destinationPath,
224 + protocol: tracked.input.protocol,
225 + },
226 {
227 onProgress: (update) =>
228 Queue.offer(pulses, undefined).pipe(Effect.andThen(progress(projectId, update))),
@@ -295,6 +301,7 @@ export const make = Effect.gen(function* () {
301 cloneUrl: prepared.cloneUrl,
302 destinationPath: prepared.destinationPath,
303 repository: prepared.repository,
304 + protocol: input.protocol ?? "auto",
305 },
306 });
307 return [true, next] as const;