Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix(health): health.cache_ttl_ms is a known config key, so the documented opt-out works without --force

garrytan5f60667318ef
diff --git a/src/core/config.ts b/src/core/config.ts
index 81f2b6725a..d3d3b939c4 100644
--- a/src/core/config.ts
+++ b/src/core/config.ts
@@ -1632,6 +1632,8 @@ export const KNOWN_CONFIG_KEYS: readonly string[] = [
'persistence.write_wait_ms', // #5232: file plane, persistence/write-wait.ts
// F4b: PGLite row-delta ANALYZE, read by src/core/planner-stats.ts (docs/guides/planner-stats.md).
'planner.auto_analyze', 'planner.first_read_budget_ms', 'import.analyze_every_pages',
+ // F4a: get_health memo TTL, read by src/core/health-memo.ts (0 disables).
+ 'health.cache_ttl_ms',
];
/**
diff --git a/test/health-memo.test.ts b/test/health-memo.test.ts
index ff20946821..862bb3ce1a 100644
--- a/test/health-memo.test.ts
+++ b/test/health-memo.test.ts
@@ -22,6 +22,7 @@ import type { OperationContext } from '../src/core/operations.ts';
import type { BrainHealth } from '../src/core/types.ts';
import { clearHealthMemo, healthScopeKey, memoizedHealth, HEALTH_CACHE_TTL_KEY } from '../src/core/health-memo.ts';
import { runRepairCommand } from '../src/commands/repair.ts';
+import { KNOWN_CONFIG_KEYS } from '../src/core/config.ts';
import { runRemediate } from '../src/commands/doctor/remediate.ts';
import { resetPgliteState } from './helpers/reset-pglite.ts';
import { withEnv } from './helpers/with-env.ts';
@@ -86,6 +87,10 @@ async function quietly<T>(fn: () => Promise<T>): Promise<T> {
}
}
+test('the documented opt-out key is a known config key, so `gbrain config set health.cache_ttl_ms 0` needs no --force', () => {
+ expect(KNOWN_CONFIG_KEYS).toContain(HEALTH_CACHE_TTL_KEY);
+});
+
describe('get_health memo (O-ENG-13)', () => {
test('a repeat call inside the TTL is memoized; a page write recomputes', async () => {
const first = await health(trusted());