Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test: register the #8064 speaker test, repair, argv reader and env name in the census tests; hook usage golden

garrytanabf0d1598f62
diff --git a/scripts/serial-files.tsv b/scripts/serial-files.tsv
index b552aec386..2a818722ac 100644
--- a/scripts/serial-files.tsv
+++ b/scripts/serial-files.tsv
@@ -448,3 +448,4 @@ test/sync-pass-phase-lines-7243.serial.test.ts global-state global-state: proces
test/embed-once-per-content-version.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests (the forced probes hold the first provider call at the transport) and pageEmbeddingLeaseProbe (the module-wide lease contention hook); withEnv scopes GBRAIN_HOME
test/page-embedding-lease.serial.test.ts global-state global-state: process-wide test seams __setEmbedTransportForTests (each case swaps the embed transport, one to a refusing provider) and pageEmbeddingLeaseProbe (the module-wide lease contention hook); withEnv scopes GBRAIN_HOME
test/migrate-search-path-best-effort.serial.test.ts R2 R2: mock.module(v277 migration module) replaces modules for every file in the process
+test/agent-session-speaker-8064.serial.test.ts R1 R1: sets GBRAIN_HOME and GBRAIN_SESSION_AGENT and clears DATABASE_URL and the hook env on process.env
diff --git a/test/cli-flag-equals.test.ts b/test/cli-flag-equals.test.ts
index 8e1f4c413b..e724f22d34 100644
--- a/test/cli-flag-equals.test.ts
+++ b/test/cli-flag-equals.test.ts
@@ -422,6 +422,7 @@ describe('#7619 split rules', () => {
'src/mcp/surface.ts': 'serve --access/--surface parsers read both forms (#7603); the entry splits the = form first',
'src/core/direct-pool-profile.ts': 'pool profile reads serve --access in both forms from the raw argv before the gate',
'src/core/workspace-push.ts': 'git child argv',
+ 'src/core/context/session-speaker.ts': 'reads another process\'s argv (claude --print=), not a gbrain flag',
'src/eval/longmemeval/via-operation.ts': 'git child argv',
};
const READER = [/['"`]--[a-z0-9-]+=/, /(?:startsWith|indexOf|===)\(?\s*`\$\{\w+\}=`/, /startsWith\(\w+ \+ '='\)/];
diff --git a/test/cli-socket.test.ts b/test/cli-socket.test.ts
index 43285388f4..490e5ce2ee 100644
--- a/test/cli-socket.test.ts
+++ b/test/cli-socket.test.ts
@@ -87,7 +87,7 @@ const NOT_READ_BEHAVIOR_PREFIXES = [
];
const NOT_READ_BEHAVIOR = new Set([
'GBRAIN_AGENT_INSTRUCTIONS', 'GBRAIN_PLUGIN', 'GBRAIN_HOME', 'GBRAIN_SERVE_LOG_MAX_BYTES', 'GBRAIN_SERVE_LOG_MAX_FILES', 'GBRAIN_SERVE_LOG_DEDUPE_SECONDS', 'GBRAIN_BRAIN_ID', 'GBRAIN_MOUNTS_PATH', 'GBRAIN_CWD_ENV_QUARANTINED',
- 'GBRAIN_FAIL_ON_EMPTY', 'GBRAIN_CLI_SOCKET', 'GBRAIN_DEBUG', 'GBRAIN_SQL_TRACE', 'GBRAIN_SQL_TRACE_LABEL', 'GBRAIN_MEMORY_TRACE', 'GBRAIN_LME_DEBUG', 'GBRAIN_SOURCE',
+ 'GBRAIN_FAIL_ON_EMPTY', 'GBRAIN_SESSION_AGENT', 'GBRAIN_CLI_SOCKET', 'GBRAIN_DEBUG', 'GBRAIN_SQL_TRACE', 'GBRAIN_SQL_TRACE_LABEL', 'GBRAIN_MEMORY_TRACE', 'GBRAIN_LME_DEBUG', 'GBRAIN_SOURCE',
'GBRAIN_DATABASE_URL', 'GBRAIN_DIRECT_DATABASE_URL', 'GBRAIN_DIRECT_POOL_SIZE', 'GBRAIN_DIRECT_POOL_BY_COMMAND', 'GBRAIN_DISABLE_DIRECT_POOL', 'GBRAIN_PREPARE',
'GBRAIN_IDLE_TX_TIMEOUT', 'GBRAIN_MAX_CONNECTIONS', 'GBRAIN_NO_RETRY_CONNECT', 'GBRAIN_DB_ACCESS',
'GBRAIN_ACCEPT_PENDING', 'GBRAIN_ACCEPT_SILENT_WIDEN', 'GBRAIN_WRITE_WAIT_MS', 'GBRAIN_ONESHOT_HOUSEKEEPING_INTERVAL_MS', 'GBRAIN_PREADMIT_CACHE', 'GBRAIN_PREPARATION_DEADLINES',
diff --git a/test/fixtures/goldens/cli/engine-free-db-down.json b/test/fixtures/goldens/cli/engine-free-db-down.json
index 36f7db7665..389d1b16a9 100644
--- a/test/fixtures/goldens/cli/engine-free-db-down.json
+++ b/test/fixtures/goldens/cli/engine-free-db-down.json
@@ -269,6 +269,8 @@
" a warm context pack; emits nothing",
"",
"Env: GBRAIN_HOOKS=0 disables all events (immediate exit 0).",
+ " GBRAIN_SESSION_AGENT=<label>|off|owner names who wrote the session's user",
+ " turns (an agent's are never saved as yours; off saves nothing).",
"All events fail open: errors exit 0 with empty stdout and a heartbeat entry at",
"<gbrain home>/integrations/hooks/heartbeat.jsonl."
],
diff --git a/test/takes-reservation-callers.test.ts b/test/takes-reservation-callers.test.ts
index de436b783f..37366b4e5d 100644
--- a/test/takes-reservation-callers.test.ts
+++ b/test/takes-reservation-callers.test.ts
@@ -25,6 +25,7 @@ const REVIEWED: Record<string, string> = {
'src/core/persistence/canonical-projections.ts': 'projects takes only, so a reservation projects no row and its old row is deleted',
'src/core/persistence/takes-prepare.ts': 'allocates with nextFreeRowNum, re-renders through upsertTakeRow/supersedeRow/replaceFence, and remove adds the reservation',
'src/core/repair/accepted-takes.ts': 'reads the archived row at a removed take\'s number (reservations are never takes) and requires the live fence to reserve that number; it re-renders with renderTakesFence keeping every other reservation',
+ 'src/core/repair/agent-session-facts.ts': 'marks previewed take rows inactive and re-renders through replaceFence, which keeps the reservations of the body it replaces',
'src/core/repair/connector-fences.ts': 'moves fence blocks verbatim, reservations included',
'src/core/repair/take-supersession.ts': 're-renders through replaceFence, which keeps the reservations of the body it replaces',
'src/core/shared-skills/migration-projection.ts': 'compares stored takes with fence takes; neither holds a reservation',