mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-29 22:48:43 +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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user