Cron isolated 任务显式模型覆盖终于生效(PR #15019)
解决“cron payload.model 写了但实际跑成默认模型”的场景:修复 session 初始化阶段的模型写入时机,确保按任务配置执行。
GITHUBDiscovered 2026-02-13Author shtse8
Prerequisites
- Cron job uses sessionTarget=isolated and payload.kind=agentTurn.
- Job definition explicitly sets payload.model (alias or full provider/model).
- You can inspect cron runs and session metadata after execution.
Steps
- Pick one isolated cron job, set payload.model to a non-default model alias, then save the job.
- Trigger the job manually and record the generated session key plus run metadata.
- Inspect persisted cron session entry/model fields and confirm they match payload.model from run start.
- Run the same job again to ensure subsequent runs keep the override instead of snapping back to default.
- If needed, pin provider+model explicitly in runbook for reproducibility.
Commands
openclaw cron listopenclaw cron run --job <jobId>openclaw cron runs --job <jobId>openclaw statusVerify
Cron isolated run uses the model from payload.model (not gateway default), and persisted session metadata reflects the override immediately.
Caveats
- This fix is for isolated cron session assignment; main-session systemEvent jobs do not use this model path.
- Model aliases/providers can differ by deployment; validate supported IDs before rollout(需验证)。
Source attribution
This tip is aggregated from community/public sources and preserved with attribution.
Open original source ↗