Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
Merge remote-tracking branch 'origin/capy/6712-pr4b-cursors' into capy/6712-pr4b-cursors
garrytandf1d75af02c4
diff --cc src/core/persistence/sync-pass-run.tsindex 053812b908,26390d03fd..5a09fd1232--- a/src/core/persistence/sync-pass-run.ts+++ b/src/core/persistence/sync-pass-run.ts@@@ -459,15 -465,10 +465,16 @@@ export async function runSyncPass(enginconst stop = async (drained: SyncResult): Promise<SyncResult> => {Object.assign(counts, { added: counts.added + drained.added, modified: counts.modified + drained.modified, deleted: counts.deleted + drained.deleted,renamed: counts.renamed + drained.renamed, chunks: counts.chunks + drained.chunksCreated, waivedImports: counts.waivedImports + (drained.waived?.imports ?? 0),- waivedDeletes: counts.waivedDeletes + (drained.waived?.deletes ?? 0) });+ waivedDeletes: counts.waivedDeletes + (drained.waived?.deletes ?? 0), skippedContextualMode: counts.skippedContextualMode + (drained.legacySkips?.contextualMode ?? 0),+ skippedCanonicalBytes: counts.skippedCanonicalBytes + (drained.legacySkips?.canonicalBytes ?? 0) });sliceBase.pages += drained.filesImported ?? 0;- if (drained.reason === 'writer_yield') yieldSettled = roundSettled + (drained.managedCursor?.index ?? 0);+ // A slice that stops mid-batch (a writer yield, a deadline, an abort) settled the entries its cursor passed: they count as+ // settled and leave the round's remaining; a blocked stop reports what its replay reports.+ if (drained.status !== 'blocked_by_failures') {+ const passed = drained.managedCursor?.index ?? 0;+ yieldSettled = roundSettled + passed;+ value.telemetry.remaining = Math.max(0, value.telemetry.remaining - passed);+ }const outcome: PassOutcome = drained.status === 'blocked_by_failures' ? 'blocked' : 'resumable';const blockedOn = drained.managedWrite?.path ? drained.managedWrite.write_request.request_id : null;if (outcome === 'blocked' && blockedOn && obligations.blocked?.request_id !== blockedOn) obligations.blocked = { request_id: blockedOn, pass_id: passId };