fix: keep mainRepoRoot optional for backward-compat with old daemons

Newer clients were rejecting checkout_status_response and
project-checkout-lite payloads from older daemons that don't yet send
mainRepoRoot. Make the field optional with a null default so the schema
stays forward-compatible.
This commit is contained in:
Mohamed Boudra
2026-04-26 13:44:23 +07:00
parent a6b89bfdf7
commit 941b4fb760
+2 -2
View File
@@ -2032,7 +2032,7 @@ export const ProjectCheckoutLiteGitNonPaseoPayloadSchema = z
remoteUrl: z.string().nullable(),
worktreeRoot: z.string().optional(),
isPaseoOwnedWorktree: z.literal(false),
mainRepoRoot: z.string().nullable(),
mainRepoRoot: z.string().nullable().optional().default(null),
})
.transform((value) => ({
...value,
@@ -2566,7 +2566,7 @@ const CheckoutStatusGitNonPaseoSchema = CheckoutStatusCommonSchema.extend({
isGit: z.literal(true),
isPaseoOwnedWorktree: z.literal(false),
repoRoot: z.string(),
mainRepoRoot: z.string().nullable(),
mainRepoRoot: z.string().nullable().optional().default(null),
currentBranch: z.string().nullable(),
isDirty: z.boolean(),
baseRef: z.string().nullable(),