Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix(persistence): the frontmatter-drift splice reads a segmented page's body materialized, as fileMatchesSnapshot does since master (#8109)

garrytana4df29888b30
diff --git a/src/core/persistence/page-prepare.ts b/src/core/persistence/page-prepare.ts
index 7144efcfbf..1e9955fcb8 100644
--- a/src/core/persistence/page-prepare.ts
+++ b/src/core/persistence/page-prepare.ts
@@ -243,6 +243,7 @@ export async function fileMatchesSnapshot(engine: BrainEngine, slug: string, byt
*/
async function frontmatterDriftWrite(engine: BrainEngine, slug: string, fileText: string, snapshot: PageSnapshot, content: string,
activePack?: ParseOpts['activePack']): Promise<string | null> {
+ snapshot = (await materializedSnapshot(engine, snapshot))!;
const file = parseMarkdown(fileText, slug, { activePack });
const type = importedFileType(file, snapshot.page, false);
const bodies = await overlayCanonicalBodies(engine.executeRaw.bind(engine), file.compiled_truth, file.timeline ?? '', snapshot.withdrawals,