mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-21 19:15:47 +00:00
fix: harden update channel switching
This commit is contained in:
parent
601f560682
commit
e06b8d3e62
8 changed files with 305 additions and 13 deletions
|
|
@ -7,6 +7,7 @@ import { setProgramContext } from "./program-context.js";
|
|||
|
||||
export function buildProgram() {
|
||||
const program = new Command();
|
||||
program.enablePositionalOptions();
|
||||
const ctx = createProgramContext();
|
||||
const argv = process.argv;
|
||||
|
||||
|
|
|
|||
|
|
@ -104,6 +104,11 @@ describe("ensureConfigReady", () => {
|
|||
commandPath: ["status"],
|
||||
expectedDoctorCalls: 0,
|
||||
},
|
||||
{
|
||||
name: "skips doctor flow for update status",
|
||||
commandPath: ["update", "status"],
|
||||
expectedDoctorCalls: 0,
|
||||
},
|
||||
{
|
||||
name: "runs doctor flow for commands that may mutate state",
|
||||
commandPath: ["message"],
|
||||
|
|
@ -145,7 +150,6 @@ describe("ensureConfigReady", () => {
|
|||
|
||||
await ensureConfigReady({ runtime: runtimeA as never, commandPath: ["message"] });
|
||||
await ensureConfigReady({ runtime: runtimeB as never, commandPath: ["message"] });
|
||||
|
||||
expect(loadAndMaybeMigrateDoctorConfigMock).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue