Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Wakeshift: move the config get gate printer into commands/wakeshift.ts (config.ts size ceilings)

garrytan00f552725b37
diff --git a/src/commands/config.ts b/src/commands/config.ts
index a7ae9d50bc..ade7bb21ad 100644
--- a/src/commands/config.ts
+++ b/src/commands/config.ts
@@ -917,12 +917,7 @@ export async function runConfig(engine: BrainEngine, args: string[]) {
// the runtime does — env/file plane wins over DB (loadConfig() already
// overlays env onto the file) — and report which plane answered on
// stderr, keeping stdout a bare value for scripts.
- if (key === 'mcp.publish_wakeshift') {
- const { wakeshiftPublished } = await import('../core/wakeshift/config.ts');
- console.log(String(wakeshiftPublished()));
- console.error('[config] source: wakeshift.enabled in the host file plane plus a usable Wakeshift key; the DB plane is never read for this gate (gbrain wakeshift status)');
- return;
- }
+ if (key === 'mcp.publish_wakeshift') return (await import('./wakeshift.ts')).printWakeshiftGate();
const filePlane = loadConfig() as Record<string, unknown> | null;
// Dotted keys (push.allow_unverified_remote, hooks.stop_push_debounce_min)
// are stored NESTED by `set`; resolve the path so `get`/`unset` see them.
diff --git a/src/commands/wakeshift.ts b/src/commands/wakeshift.ts
index adedba2978..f3cc3e96f9 100644
--- a/src/commands/wakeshift.ts
+++ b/src/commands/wakeshift.ts
@@ -14,7 +14,7 @@ import { loadConfigFileOnly, saveConfig, type GBrainConfig } from '../core/confi
import { opError } from '../core/ops/contract.ts';
import { requireConsent } from '../core/consent.ts';
import { WakeshiftError, WakeshiftKeyError, normalizeWakeshiftUrl, parseWakeshiftKey, wakeshiftClient, type WakeshiftKey } from '../core/wakeshift/client.ts';
-import { readWakeshiftKey, wakeshiftFileConfig, wakeshiftKeyFile, wakeshiftSecret } from '../core/wakeshift/config.ts';
+import { readWakeshiftKey, wakeshiftFileConfig, wakeshiftKeyFile, wakeshiftPublished, wakeshiftSecret } from '../core/wakeshift/config.ts';
import { wakeshiftManifest } from '../core/wakeshift/events.ts';
import { endAtWakeshift } from '../core/wakeshift/drain.ts';
import { setCliExitVerdict } from '../core/cli-force-exit.ts';
@@ -188,6 +188,12 @@ async function test(json: boolean): Promise<void> {
}
}
+/** `gbrain config get mcp.publish_wakeshift`: the runtime gate, which never reads the DB plane. */
+export function printWakeshiftGate(): void {
+ console.log(String(wakeshiftPublished()));
+ console.error('[config] source: wakeshift.enabled in the host file plane plus a usable Wakeshift key; the DB plane is never read for this gate (gbrain wakeshift status)');
+}
+
export async function runWakeshift(engine: BrainEngine, args: string[]): Promise<void> {
const sub = args[0];
const json = args.includes('--json');