feat: enhance bootstrap hook with detailed logging and internal hook configuration

This commit is contained in:
Lauren ten Hoor
2026-02-16 15:43:53 +08:00
parent 6be920c31a
commit 1464fa82d2
2 changed files with 26 additions and 5 deletions

View File

@@ -35,6 +35,7 @@ export async function writePluginConfig(
// Clean up legacy models from openclaw.json (moved to workflow.yaml)
delete (config as any).plugins.entries.devclaw.config.models;
ensureInternalHooks(config);
ensureHeartbeatDefaults(config);
configureSubagentCleanup(config);
@@ -77,6 +78,13 @@ function addToolRestrictions(config: Record<string, unknown>, agentId: string):
}
}
function ensureInternalHooks(config: Record<string, unknown>): void {
if (!config.hooks) config.hooks = {};
const hooks = config.hooks as Record<string, unknown>;
if (!hooks.internal) hooks.internal = {};
(hooks.internal as Record<string, unknown>).enabled = true;
}
function ensureHeartbeatDefaults(config: Record<string, unknown>): void {
const devclaw = (config as any).plugins.entries.devclaw.config;
if (!devclaw.work_heartbeat) {