
















@@ -18,6 +18,7 @@ import {
1818getCronChannelOptions,
1919parseCronCommandArgv,
2020parseCronCommandEnv,
21+parseCronFallbacks,
2122parseCronToolsAllow,
2223parseDurationMs,
2324warnIfCronSchedulerDisabled,
@@ -112,6 +113,8 @@ export function registerCronEditCommand(cron: Command) {
112113"Thinking level for agent jobs (off|minimal|low|medium|high|xhigh)",
113114)
114115.option("--model <model>", "Model override for agent jobs")
116+.option("--fallbacks <list>", "Fallback model list for agent jobs")
117+.option("--clear-fallbacks", "Remove per-job fallback override", false)
115118.option(
116119"--clear-model",
117120"Remove the per-job model override (restore normal cron model precedence)",
@@ -289,6 +292,10 @@ export function registerCronEditCommand(cron: Command) {
289292throw new Error("Use --model or --clear-model, not both");
290293}
291294const thinking = normalizeOptionalString(opts.thinking);
295+const fallbacks = parseCronFallbacks(opts.fallbacks);
296+if (typeof opts.fallbacks === "string" && opts.clearFallbacks) {
297+throw new Error("Use --fallbacks or --clear-fallbacks, not both");
298+}
292299const toolsAllow = parseCronToolsAllow(opts.tools);
293300const rawTimeoutSeconds =
294301opts.timeoutSeconds === undefined ? undefined : String(opts.timeoutSeconds).trim();
@@ -360,6 +367,8 @@ export function registerCronEditCommand(cron: Command) {
360367!hasCommandSpecificPayloadField &&
361368typeof opts.message !== "string" &&
362369!model &&
370+typeof opts.fallbacks !== "string" &&
371+!opts.clearFallbacks &&
363372!thinking &&
364373typeof opts.lightContext !== "boolean" &&
365374typeof opts.tools !== "string" &&
@@ -373,6 +382,8 @@ export function registerCronEditCommand(cron: Command) {
373382typeof opts.message === "string" ||
374383Boolean(model) ||
375384Boolean(opts.clearModel) ||
385+typeof opts.fallbacks === "string" ||
386+Boolean(opts.clearFallbacks) ||
376387Boolean(thinking) ||
377388(hasTimeoutSeconds &&
378389!hasCommandSpecificPayloadField &&
@@ -405,6 +416,8 @@ export function registerCronEditCommand(cron: Command) {
405416} else {
406417assignIf(payload, "model", model, Boolean(model));
407418}
419+assignIf(payload, "fallbacks", fallbacks, typeof opts.fallbacks === "string");
420+assignIf(payload, "fallbacks", null, Boolean(opts.clearFallbacks));
408421assignIf(payload, "thinking", thinking, Boolean(thinking));
409422assignIf(payload, "timeoutSeconds", timeoutSeconds, hasTimeoutSeconds);
410423assignIf(
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。