Skip to content

Commit 949210a

Browse files
fix(configure): retain legacy owner marker
1 parent 6e9a9ef commit 949210a

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎src/commands/configure.wizard.default-agent.test.ts‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ describe("runConfigureWizard default-agent ownership", () => {
290290
});
291291

292292
it("keeps a workspace-less legacy owner on the global workspace", async () => {
293-
const baseConfig = retainLegacyDefaultAgentId({
293+
const baseConfig = {
294294
agents: {
295295
defaults: {
296296
workspace: "/tmp/global-workspace",
@@ -303,7 +303,8 @@ describe("runConfigureWizard default-agent ownership", () => {
303303
},
304304
},
305305
},
306-
} satisfies OpenClawConfig, "ops");
306+
} satisfies OpenClawConfig;
307+
retainLegacyDefaultAgentId(baseConfig, "ops");
307308
mocks.state.snapshot = {
308309
exists: true,
309310
valid: true,
@@ -330,16 +331,16 @@ describe("runConfigureWizard default-agent ownership", () => {
330331
}),
331332
);
332333
expect(mocks.setupPluginConfig).toHaveBeenCalledWith(
333-
expect.objectContaining({ workspaceDir: "/tmp/new-global-workspace/ops" }),
334+
expect.objectContaining({ workspaceDir: "/tmp/new-global-workspace" }),
334335
);
335336
expect(mocks.setupSkills).toHaveBeenCalledWith(
336337
expect.any(Object),
337-
"/tmp/new-global-workspace/ops",
338+
"/tmp/new-global-workspace",
338339
runtime,
339340
expect.any(Object),
340341
);
341342
expect(mocks.ensureWorkspaceAndSessions).toHaveBeenCalledWith(
342-
"/tmp/new-global-workspace/ops",
343+
"/tmp/new-global-workspace",
343344
runtime,
344345
expect.objectContaining({ agentId: "ops" }),
345346
);

‎src/commands/configure.wizard.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { formatCliCommand } from "../cli/command-format.js";
88
import { formatPortRangeHint } from "../cli/error-format.js";
99
import { parsePort } from "../cli/shared/parse-port.js";
1010
import { readConfigFileSnapshotForWrite, resolveGatewayPort } from "../config/config.js";
11-
import { tryResolveLegacyCompatibilityAgentId } from "../config/legacy.default-agent-owner.js";
11+
import { inheritLegacyDefaultAgentId } from "../config/legacy.default-agent-owner.js";
1212
import { logConfigUpdated } from "../config/logging.js";
1313
import type { OpenClawConfig } from "../config/types.openclaw.js";
1414
import { resolveGatewayProbeAuthSafeWithSecretInputs } from "../gateway/probe-auth.js";
@@ -598,7 +598,6 @@ export async function runConfigureWizard(
598598
return;
599599
}
600600

601-
const legacySetupAgentId = tryResolveLegacyCompatibilityAgentId(baseConfig);
602601
let nextConfig = { ...baseConfig };
603602
let mergeBaseConfig = structuredClone(baseConfig);
604603
let didSetGatewayMode = false;
@@ -617,7 +616,7 @@ export async function runConfigureWizard(
617616
const resolveSetupTarget = () =>
618617
nextConfig.agents?.ownership === "explicit"
619618
? resolveSystemAgentOnboardingTarget(nextConfig)
620-
: resolveOnboardingAgentTarget(nextConfig, legacySetupAgentId);
619+
: resolveOnboardingAgentTarget(inheritLegacyDefaultAgentId(baseConfig, nextConfig));
621620
let workspaceDir = resolveSetupTarget().workspaceDir;
622621
let gatewayPort = resolveGatewayPort(baseConfig);
623622

0 commit comments

Comments
 (0)