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

This commit is contained in:
Gabriel Brown committed 2026-07-10 17:15:20 -04:00
1 parent 57c175aecd
commit bdb2964e34
5 files changed
+231 -3

No files matched your search

+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';