Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix(loops): loops extraction dedups as the local maintenance job it is (#5152)

garrytane7128a58bfe5
diff --git a/src/core/google/loops-extract.ts b/src/core/google/loops-extract.ts
index 192edd4e41..773d36d83d 100644
--- a/src/core/google/loops-extract.ts
+++ b/src/core/google/loops-extract.ts
@@ -447,7 +447,10 @@ export async function runLoopsExtract(
await maintenanceTransaction(engine, tx => applyGateDecision(tx, gate, { table: 'facts', sourceId: payload.sourceId }, async () => null));
} else {
const { writeSingleFact } = await import('../facts/write-single.ts');
- factId = (await writeSingleFact(engine, payload.sourceId, { ...fact, derivation, gate })).id;
+ // Loops extraction is a local maintenance job on the owner host, so its
+ // dedup may see facts whose provenance page is private (#5152); an unset
+ // trust would treat every private-sourced repeat as new and insert it.
+ factId = (await writeSingleFact(engine, payload.sourceId, { ...fact, derivation, gate, remote: false })).id;
}
} catch (err) {
// The loop row still lands; the facts projection is best-effort, but its