fix(sync): honor per-spoon auto-sync settings

This commit is contained in:
Gabriel Brown
2026-07-10 17:15:20 -04:00
parent 57c175aecd
commit bdb2964e34
5 changed files with 231 additions and 3 deletions
+19
View File
@@ -0,0 +1,19 @@
export const shouldAutoSync = (
settings: {
autoSyncEnabled: boolean;
requireCleanCompareForSync: boolean;
},
ctx: { status: string; forkAheadBy: number },
): boolean => {
if (!settings.autoSyncEnabled) return false;
if (ctx.status !== 'behind') return false;
if (settings.requireCleanCompareForSync && ctx.forkAheadBy !== 0) {
return false;
}
return ctx.forkAheadBy === 0;
};
export const shouldCreateReviewThread = (
settings: { autoReviewEnabled: boolean },
ctx: { status: string },
): boolean => settings.autoReviewEnabled && ctx.status === 'diverged';