mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-29 16:15:14 +00:00
fix(cli): preserve explicit command intent
This commit is contained in:
@@ -55,4 +55,24 @@ describe("cron edit command", () => {
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it("does not imply announce mode for --no-best-effort-deliver alone", async () => {
|
||||
const program = createCronProgram();
|
||||
|
||||
await program.parseAsync(["edit", "job-1", "--no-best-effort-deliver"], { from: "user" });
|
||||
|
||||
expect(callGatewayFromCli).toHaveBeenCalledWith(
|
||||
"cron.update",
|
||||
expect.objectContaining({ bestEffortDeliver: false }),
|
||||
{
|
||||
id: "job-1",
|
||||
patch: {
|
||||
payload: { kind: "agentTurn" },
|
||||
delivery: {
|
||||
bestEffort: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -299,7 +299,7 @@ export function registerCronEditCommand(cron: Command) {
|
||||
const delivery: Record<string, unknown> = {};
|
||||
if (hasDeliveryModeFlag) {
|
||||
delivery.mode = opts.announce || opts.deliver === true ? "announce" : "none";
|
||||
} else if (hasBestEffort) {
|
||||
} else if (opts.bestEffortDeliver === true) {
|
||||
// Back-compat: toggling best-effort alone has historically implied announce mode.
|
||||
delivery.mode = "announce";
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ describe("update cli option collisions", () => {
|
||||
},
|
||||
{
|
||||
name: "forwards parent-captured --json/--timeout to hidden `update finalize`",
|
||||
argv: ["update", "finalize", "--json", "--timeout", "17", "--no-restart"],
|
||||
argv: ["update", "finalize", "--json", "--timeout", "17"],
|
||||
assert: () => {
|
||||
expect(updateFinalizeCommand).toHaveBeenCalledTimes(1);
|
||||
const opts = firstCallOptions(updateFinalizeCommand);
|
||||
@@ -87,6 +87,17 @@ describe("update cli option collisions", () => {
|
||||
).toBe(false);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "keeps hidden `update finalize --no-restart` as a no-op parity flag",
|
||||
argv: ["update", "finalize", "--no-restart"],
|
||||
assert: () => {
|
||||
expect(updateFinalizeCommand).toHaveBeenCalledTimes(1);
|
||||
const opts = firstCallOptions(updateFinalizeCommand);
|
||||
expect(
|
||||
(opts as { json?: boolean; timeout?: string; restart?: boolean } | undefined)?.restart,
|
||||
).toBe(false);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "forwards parent-captured --timeout to `update wizard`",
|
||||
argv: ["update", "wizard", "--timeout", "13"],
|
||||
|
||||
@@ -131,7 +131,7 @@ ${theme.muted("Docs:")} ${formatDocsLink("/cli/update", "docs.openclaw.ai/cli/up
|
||||
channel: opts.channel as string | undefined,
|
||||
timeout: inheritedUpdateTimeout(opts, command),
|
||||
yes: Boolean(opts.yes),
|
||||
restart: Boolean(opts.restart),
|
||||
restart: false,
|
||||
});
|
||||
} catch (err) {
|
||||
defaultRuntime.error(String(err));
|
||||
|
||||
Reference in New Issue
Block a user