Skip to content

Commit 1beb963

Browse files
fix(cli): keep config writes out of state migration (#120451)
Targeted config writes retain validation while Doctor and the gateway own state migration. Fixes #120413 Co-authored-by: Peter Steinberger <[email protected]>
1 parent 5b97cbe commit 1beb963

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

‎src/cli/argv.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,8 @@ describe("argv helpers", () => {
766766
{ argv: ["node", "openclaw", "--log-level=debug", "models", "list"], expected: true },
767767
{ argv: ["node", "openclaw", "config", "get", "update"], expected: false },
768768
{ argv: ["node", "openclaw", "config", "unset", "update"], expected: false },
769+
{ argv: ["node", "openclaw", "config", "set", "update.channel", "beta"], expected: false },
770+
{ argv: ["node", "openclaw", "config", "patch", "update", "{}"], expected: false },
769771
{ argv: ["node", "openclaw", "models", "list"], expected: true },
770772
{ argv: ["node", "openclaw", "models", "status"], expected: true },
771773
{ argv: ["node", "openclaw", "update", "status", "--json"], expected: false },

‎src/cli/argv.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ export function shouldMigrateStateFromPath(path: string[]): boolean {
625625
if (primary === "update" && secondary === "status") {
626626
return false;
627627
}
628-
if (primary === "config" && (secondary === "get" || secondary === "unset")) {
628+
if (primary === "config") {
629629
return false;
630630
}
631631
return true;

‎src/cli/program/config-guard.test.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,16 @@ describe("ensureConfigReady", () => {
179179
commandPath: ["gateway", "call"],
180180
expectedDoctorCalls: 0,
181181
},
182+
{
183+
name: "skips doctor flow for config set",
184+
commandPath: ["config", "set"],
185+
expectedDoctorCalls: 0,
186+
},
187+
{
188+
name: "skips doctor flow for config patch",
189+
commandPath: ["config", "patch"],
190+
expectedDoctorCalls: 0,
191+
},
182192
{
183193
name: "skips doctor flow for agent without legacy state",
184194
commandPath: ["agent"],

0 commit comments

Comments
 (0)