fix(cli): preserve explicit command intent

This commit is contained in:
Peter Steinberger
2026-05-24 01:17:50 +01:00
parent a4e95cf7b1
commit 9410eb30cf
4 changed files with 34 additions and 3 deletions

View File

@@ -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,
},
},
},
);
});
});

View File

@@ -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";
}