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.
This commit is contained in:
committed by
Peter Steinberger
parent
eec082e541
commit
314e075df2
@@ -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 <jobId> --force
|
||||
|
||||
@@ -296,6 +296,10 @@ export function registerCronCli(program: Command) {
|
||||
"--thinking <level>",
|
||||
"Thinking level for agent jobs (off|minimal|low|medium|high)",
|
||||
)
|
||||
.option(
|
||||
"--model <model>",
|
||||
"Model override for agent jobs (provider/model or alias)",
|
||||
)
|
||||
.option("--timeout-seconds <n>", "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 <text>", "Set systemEvent payload")
|
||||
.option("--message <text>", "Set agentTurn payload message")
|
||||
.option("--thinking <level>", "Thinking level for agent jobs")
|
||||
.option("--model <model>", "Model override for agent jobs")
|
||||
.option("--timeout-seconds <n>", "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:
|
||||
|
||||
Reference in New Issue
Block a user