fix: trim cron model overrides and doc guidance (#711) (thanks @mjrussell)

This commit is contained in:
Peter Steinberger
2026-01-11 10:52:40 +00:00
parent 314e075df2
commit a8a4993ffd
4 changed files with 125 additions and 3 deletions

View File

@@ -646,15 +646,22 @@ export function registerCronCli(program: Command) {
text: String(opts.systemEvent),
};
} else if (opts.message) {
const model =
typeof opts.model === "string" && opts.model.trim()
? opts.model.trim()
: undefined;
const thinking =
typeof opts.thinking === "string" && opts.thinking.trim()
? opts.thinking.trim()
: undefined;
const timeoutSeconds = opts.timeoutSeconds
? Number.parseInt(String(opts.timeoutSeconds), 10)
: undefined;
patch.payload = {
kind: "agentTurn",
message: String(opts.message),
model: typeof opts.model === "string" ? opts.model : undefined,
thinking:
typeof opts.thinking === "string" ? opts.thinking : undefined,
model,
thinking,
timeoutSeconds:
timeoutSeconds && Number.isFinite(timeoutSeconds)
? timeoutSeconds