From 314e075df2060a92a2995d8b8d855f53e6f7ec8a Mon Sep 17 00:00:00 2001 From: Matthew Russell Date: Sat, 10 Jan 2026 22:32:09 -0800 Subject: [PATCH] feat(cron): add --model flag to cron add/edit commands Expose the existing model override capability via CLI flags: - Add --model to cron add and cron edit commands - Document model and thinking overrides in cron-jobs.md - Add CLI example showing model/thinking usage The backend already supported model in agentTurn payloads; this change exposes it through the CLI interface. --- docs/automation/cron-jobs.md | 27 ++++++++++++++++++++++++++- src/cli/cron-cli.ts | 10 ++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/docs/automation/cron-jobs.md b/docs/automation/cron-jobs.md index 56852b65f..69cd4b526 100644 --- a/docs/automation/cron-jobs.md +++ b/docs/automation/cron-jobs.md @@ -61,9 +61,19 @@ Key behaviors: - `wakeMode: "now"` triggers an immediate heartbeat after posting the summary. - If `payload.deliver: true`, output is delivered to a provider; otherwise it stays internal. -Use isolated jobs for noisy, frequent, or “background chores” that shouldn’t spam +Use isolated jobs for noisy, frequent, or "background chores" that shouldn't spam your main chat history. +### Model and thinking overrides +Isolated jobs (`agentTurn`) can override the model and thinking level: +- `model`: Provider/model string (e.g., `anthropic/claude-sonnet-4-20250514`) or alias (e.g., `opus`) +- `thinking`: Thinking level (`off`, `minimal`, `low`, `medium`, `high`) + +Resolution priority: +1. Job payload override (highest) +2. Hook-specific defaults (e.g., `hooks.gmail.model`) +3. Agent config default + ### Delivery (provider + target) Isolated jobs can deliver output to a provider. The job payload can specify: - `provider`: `whatsapp` / `telegram` / `discord` / `slack` / `signal` / `imessage` / `last` @@ -142,6 +152,21 @@ clawdbot cron add \ --to "-1001234567890:topic:123" ``` +Isolated job with model and thinking override: +```bash +clawdbot cron add \ + --name "Deep analysis" \ + --cron "0 6 * * 1" \ + --tz "America/Los_Angeles" \ + --session isolated \ + --message "Weekly deep analysis of project progress." \ + --model "opus" \ + --thinking high \ + --deliver \ + --provider whatsapp \ + --to "+15551234567" +``` + Manual run (debug): ```bash clawdbot cron run --force diff --git a/src/cli/cron-cli.ts b/src/cli/cron-cli.ts index aa7a4b5c7..9c18c925e 100644 --- a/src/cli/cron-cli.ts +++ b/src/cli/cron-cli.ts @@ -296,6 +296,10 @@ export function registerCronCli(program: Command) { "--thinking ", "Thinking level for agent jobs (off|minimal|low|medium|high)", ) + .option( + "--model ", + "Model override for agent jobs (provider/model or alias)", + ) .option("--timeout-seconds ", "Timeout seconds for agent jobs") .option("--deliver", "Deliver agent output", false) .option( @@ -391,6 +395,10 @@ export function registerCronCli(program: Command) { return { kind: "agentTurn" as const, message, + model: + typeof opts.model === "string" && opts.model.trim() + ? opts.model.trim() + : undefined, thinking: typeof opts.thinking === "string" && opts.thinking.trim() ? opts.thinking.trim() @@ -558,6 +566,7 @@ export function registerCronCli(program: Command) { .option("--system-event ", "Set systemEvent payload") .option("--message ", "Set agentTurn payload message") .option("--thinking ", "Thinking level for agent jobs") + .option("--model ", "Model override for agent jobs") .option("--timeout-seconds ", "Timeout seconds for agent jobs") .option("--deliver", "Deliver agent output", false) .option( @@ -643,6 +652,7 @@ export function registerCronCli(program: Command) { patch.payload = { kind: "agentTurn", message: String(opts.message), + model: typeof opts.model === "string" ? opts.model : undefined, thinking: typeof opts.thinking === "string" ? opts.thinking : undefined, timeoutSeconds: