Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix: pre-landing review fixes

garrytan20411a2f8300
diff --git a/src/core/google/people-calendar-sweep.ts b/src/core/google/people-calendar-sweep.ts
index 85cf3a4ca9..2951741491 100644
--- a/src/core/google/people-calendar-sweep.ts
+++ b/src/core/google/people-calendar-sweep.ts
@@ -55,6 +55,7 @@ export async function sweepContacts(
// from page 1 to the end in one run, as it did before the checkpoint.
const resumeToken = !deps.opts.full && state.contacts_relist?.person_fields === CONTACT_PERSON_FIELDS ? state.contacts_relist.page_token : null;
const pageBudget = deps.opts.full ? Infinity : CONTACT_RELIST_PAGES_PER_RUN;
+ if (deps.opts.full) state.contacts_relist = null;
const syncToken = deps.opts.full || maskChanged || resumeToken ? null : state.contacts_sync_token;
if (maskChanged && state.contacts_sync_token && !deps.opts.full && !resumeToken) deps.log('[google] contacts field mask changed; full re-list');
let groupNames: Record<string, string> | null = null;
diff --git a/test/contacts-relist-checkpoint-8906.slow.test.ts b/test/contacts-relist-checkpoint-8906.slow.test.ts
index 9715f3dcdd..a6e50067e1 100644
--- a/test/contacts-relist-checkpoint-8906.slow.test.ts
+++ b/test/contacts-relist-checkpoint-8906.slow.test.ts
@@ -214,4 +214,18 @@ test('--full ignores a saved re-list checkpoint and the page budget: it lists fr
rmSync(dir, { recursive: true, force: true });
}
}, 240_000);
+test('--full drops a saved re-list checkpoint even when it stops before writing its own, so the next sync starts at page 1', async () => {
+ const { dir, cfg } = await googleSource();
+ try {
+ seedState(dir, { contacts_sync_token: null, contacts_person_fields: CONTACT_PERSON_FIELDS, contacts_relist: { page_token: 'p3', person_fields: CONTACT_PERSON_FIELDS } });
+ const controller = new AbortController();
+ const api = peopleApi(4, { onList: () => controller.abort() });
+ await withEnv({ GBRAIN_HOME: mkdtempSync(join(tmpdir(), 'gbrain-home-8906-')), GBRAIN_TEST_8906_TOKEN: 'synthetic-fixture-token' }, () =>
+ runGoogleSync(engine, 'gsrc', cfg, { sourceId: 'gsrc', full: true, noEmbed: true, noExtract: true, noSchemaPack: true, signal: controller.signal }, api.fetchImpl)).catch(() => {});
+ expect(api.requests.map((r) => r.pageToken)).toEqual([null]);
+ expect(relistOf(dir)).toBeNull();
+ } finally {
+ rmSync(dir, { recursive: true, force: true });
+ }
+ }, 60_000);
});