Cron model migration

From aAAaqwq/AGI-Super-Team · View interactive version

Cron model migration is an AI agent skill from the GitHub repository aAAaqwq/AGI-Super-Team. Safely change models for OpenClaw cron jobs without leaving behind session/model mismatch errors. Use when creating or editing cron jobs with `payload.model`, when moving a job between models/providers, when diagnosing `LiveSessionModelSwitchError`, or when deciding whether a cron should run in `ses

How to use this skill

Skill file

Cron Model Migration

Overview

Use this skill when a cron job needs a model change or when cron runs fail after a model change. The goal is simple: avoid reusing a session that is already bound to a different model.

Core rule

Prefer sessionTarget: "isolated" for cron jobs that set payload.model.

Why:

If a cron does not need shared conversation history, keep it isolated.

Decision tree

Case 1 — New cron job with a specific model

Create it as:

Do not bind it to current or session:xxx unless you explicitly need persistent context across runs.

Case 2 — Existing isolated cron, same session pattern, just changing model

Safe workflow:

  1. Confirm the job is not actively running.
  2. Disable the job.
  3. Update payload.model.
  4. Restart Gateway if the job has recently been running or already failed with a model-switch error.
  5. Re-enable the job.
  6. Force-run once and inspect the result.

If it still throws LiveSessionModelSwitchError, stop trying to patch it in place. Rebuild the job fresh.

Case 3 — Existing cron bound to `current` or `session:xxx`

Treat this as high risk for model residue.

Best practice:

Do not reuse a persistent session and expect model changes to be clean.

Case 4 — Main-session cron

Avoid model overrides on main-session jobs unless there is a strong reason.

Why:

If the task needs a different model, split it into an isolated cron instead.

Recommended migration workflow

Use this sequence for production changes:

  1. Inspect
  1. Classify
  1. Apply
  1. Verify
  1. Cut over

Anti-patterns

Avoid these:

Troubleshooting `LiveSessionModelSwitchError`

When you see:

Assume one of these first:

  1. the job is reusing a live or persistent session already bound to another model
  2. the job was edited in place after prior runs left session state behind
  3. the job is using current, main, or a custom persistent session where override behavior is unsafe

Response order:

  1. inspect job config
  2. confirm sessionTarget
  3. confirm whether the run is isolated or persistent
  4. restart Gateway if stale execution state is plausible
  5. if still failing, replace the job with a fresh isolated one

Minimal safe templates

Stateless background analysis

Use:

Persistent weekly summary that truly needs memory

Use:

Practical rule of thumb

If you need to ask “can I safely switch this cron’s model in place?”, the default answer is:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.