cron-model-migration

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 `sessionTarget: "isolated"`, `"current"`, `"main"`, or a custom persistent session.

33 stars

Best use case

cron-model-migration is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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 `sessionTarget: "isolated"`, `"current"`, `"main"`, or a custom persistent session.

Teams using cron-model-migration should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/cron-model-migration/SKILL.md --create-dirs "https://raw.githubusercontent.com/aAAaqwq/AGI-Super-Team/main/skills/cron-model-migration/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/cron-model-migration/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How cron-model-migration Compares

Feature / Agentcron-model-migrationStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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 `sessionTarget: "isolated"`, `"current"`, `"main"`, or a custom persistent session.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 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:
- isolated jobs run dedicated agent turns instead of sharing the main session
- isolated runs are the safest place to override model/thinking
- persistent/shared sessions are where model-switch residue shows up most often

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:
- `payload.kind = "agentTurn"`
- `sessionTarget = "isolated"`
- `payload.model = <target-model>`

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:
- create a **new job** instead of editing the old one in place
- move it to `sessionTarget: "isolated"` unless persistent context is truly required
- if persistent context is required, use a **new custom session id** instead of reusing the old one

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:
- main-session jobs share context with the main agent session
- changing model there can shift the shared session unexpectedly
- OpenClaw docs recommend model overrides primarily for isolated jobs

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**
   - confirm `sessionTarget`
   - confirm `payload.kind`
   - confirm current `payload.model`
   - check recent run failures

2. **Classify**
   - isolated + stateless → update in place is usually fine
   - current/custom/main → prefer rebuild

3. **Apply**
   - small change: disable → update → restart → enable → force-run
   - risky change or prior switch error: create a new isolated job with the new model

4. **Verify**
   - run exactly once with `cron.run`
   - verify the run completed, not merely enqueued
   - verify delivery/output still works

5. **Cut over**
   - only remove the old job after the replacement job succeeds

## Anti-patterns

Avoid these:
- changing `payload.model` and immediately force-running repeatedly
- reusing `sessionTarget: "current"` for jobs that need model churn
- editing a persistent `session:xxx` job without changing the backing session id
- assuming `cron.run` enqueue success means the agent turn succeeded
- debugging only the prompt while ignoring session binding

## Troubleshooting `LiveSessionModelSwitchError`

When you see:
- `LiveSessionModelSwitchError: Live session model switch requested: ...`

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:
- `sessionTarget: "isolated"`
- `payload.kind: "agentTurn"`
- explicit `payload.model`
- optional `delivery.mode: "announce"` or `"none"`

### Persistent weekly summary that truly needs memory

Use:
- `sessionTarget: "session:<new-id>"`
- `payload.kind: "agentTurn"`
- explicit `payload.model`
- accept that model changes later should usually mean **creating a new session id/job**

## Practical rule of thumb

If you need to ask “can I safely switch this cron’s model in place?”, the default answer is:
- **yes** for isolated/stateless jobs, with one controlled validation run
- **no** for shared or persistent jobs; rebuild instead

Related Skills

startup-financial-modeling

33
from aAAaqwq/AGI-Super-Team

Use when the user asks to create financial projections, build a financial model, forecast revenue, calculate burn rate, estimate runway, model cash flow, or do 3-5 year startup financial planning.

model-usage

33
from aAAaqwq/AGI-Super-Team

Use CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.

model-usage-linux

33
from aAAaqwq/AGI-Super-Team

Track OpenClaw AI token usage and cost per model on Linux by parsing session JSONL files. Use when asked about: token usage, API cost, how much has been spent, which model was used most, usage summary, billing, cost breakdown. Linux replacement for the macOS-only model-usage/CodexBar skill.

model-provider-manager

33
from aAAaqwq/AGI-Super-Team

Unified LLM provider and model configuration, health monitoring, and key management

model-hierarchy-skill

33
from aAAaqwq/AGI-Super-Team

> 模型层级调度——根据任务复杂度自动选择合适的 LLM 模型

model-health-check

33
from aAAaqwq/AGI-Super-Team

检查已配置模型供应商的连通性、延迟和可用性,用于快速诊断模型侧故障。

model-fallback

33
from aAAaqwq/AGI-Super-Team

模型自动降级与故障切换。当主模型请求失败、超时、达到速率限制或配额耗尽时,自动切换到备用模型,确保服务连续性。支持多供应商、多优先级的智能模型选择,提供健康监控、自动重试和错误恢复机制。

cron-manager

33
from aAAaqwq/AGI-Super-Team

创建、监控、诊断和修复 OpenClaw cron 任务,支持自然语言时间与常见故障排查。

agent-model-switcher

33
from aAAaqwq/AGI-Super-Team

批量查看和切换子 agent 的模型配置,用于统一调整多 agent 的 provider/model 设置。

wemp-operator

33
from aAAaqwq/AGI-Super-Team

> 微信公众号全功能运营——草稿/发布/评论/用户/素材/群发/统计/菜单/二维码 API 封装

Content & Documentation

zsxq-smart-publish

33
from aAAaqwq/AGI-Super-Team

Publish and manage content on 知识星球 (zsxq.com). Supports talk posts, Q&A, long articles, file sharing, digest/bookmark, homework tasks, and tag management. Use when publishing content to 知识星球, creating/editing posts, uploading files/images/audio, managing digests, batch publishing, or formatting content for 知识星球.

zoom-automation

33
from aAAaqwq/AGI-Super-Team

Automate Zoom meeting creation, management, recordings, webinars, and participant tracking via Rube MCP (Composio). Always search tools first for current schemas.