fix(state): auto-migrate legacy agent dir

This commit is contained in:
Peter Steinberger
2026-01-06 22:04:23 +00:00
parent 7aa7fa79d0
commit 2771001720
6 changed files with 570 additions and 457 deletions

View File

@@ -54,6 +54,7 @@ import { startHeartbeatRunner } from "../infra/heartbeat-runner.js";
import { requestHeartbeatNow } from "../infra/heartbeat-wake.js";
import { getMachineDisplayName } from "../infra/machine-name.js";
import { ensureClawdbotCliOnPath } from "../infra/path-env.js";
import { autoMigrateLegacyAgentDir } from "../infra/state-migrations.js";
import { enqueueSystemEvent } from "../infra/system-events.js";
import {
listSystemPresence,
@@ -388,6 +389,7 @@ export async function startGatewayServer(
}
const cfgAtStart = loadConfig();
await autoMigrateLegacyAgentDir({ cfg: cfgAtStart, log });
const bindMode = opts.bind ?? cfgAtStart.gateway?.bind ?? "loopback";
const bindHost = opts.host ?? resolveGatewayBindHost(bindMode);
if (!bindHost) {