Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

storage manifest: keep the pre-admission cache on the page door source read

garrytan37fc0b94006d
diff --git a/src/core/persistence/preadmit-cache.ts b/src/core/persistence/preadmit-cache.ts
index 1d78418240..d9e79e9dac 100644
--- a/src/core/persistence/preadmit-cache.ts
+++ b/src/core/persistence/preadmit-cache.ts
@@ -23,7 +23,7 @@ import { registerEngineView, writeSwitchOn } from './switches.ts';
export const PREADMIT_TTL_MS = 30_000;
const BRAIN_SQL = 'SELECT brain_id FROM persistence_brain WHERE singleton=1';
-const SOURCE_SQL = "SELECT incarnation,archived,local_path,config->>'kind' AS kind FROM sources WHERE id=$1";
+const SOURCE_SQL = "SELECT incarnation,archived,local_path,config->>'kind' AS kind,config->>'role' AS role FROM sources WHERE id=$1";
const BINDING_SQL = 'SELECT s.source_id,s.source_incarnation,s.worktree_id,s.relative_path, s.topology_generation::text AS topology_generation,w.owner_host_id,w.owner_epoch::text AS owner_epoch,w.state, h.local_path,h.coordination_path FROM persistence_source_bindings s JOIN persistence_worktrees w ON w.id=s.worktree_id LEFT JOIN persistence_host_bindings h ON h.worktree_id=w.id AND h.host_id=$2::uuid WHERE s.source_id=$1';
const WRITER_SQL = new Set([
'SELECT revoked_at,credential_hash,lane FROM persistence_local_writers WHERE id=$1::uuid',
diff --git a/test/e2e/single-write-fast-path-postgres.test.ts b/test/e2e/single-write-fast-path-postgres.test.ts
index ec39293b31..2cd1fb29f3 100644
--- a/test/e2e/single-write-fast-path-postgres.test.ts
+++ b/test/e2e/single-write-fast-path-postgres.test.ts
@@ -39,7 +39,7 @@ function countStatements(engine: BrainEngine, fragment: string): { count: () =>
return { count: () => n, restore: () => { proto.executeRaw = original; } };
}
const GROUP_COMPLETION = "UPDATE persistence_requests r SET state='committed'";
-const SOURCE_READ = "SELECT incarnation,archived,local_path,config->>'kind' AS kind FROM sources WHERE id=$1";
+const SOURCE_READ = "SELECT incarnation,archived,local_path,config->>'kind' AS kind,config->>'role' AS role FROM sources WHERE id=$1";
afterEach(() => { installFaultHook(undefined); resetWriteSwitches(); });