← 返回 Skills 市场
mklue

Cron Model Fix

作者 mklue · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
98
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install cron-model-fix
功能描述
Diagnose and fix OpenClaw cron job model override issues. Use when cron jobs show "not allowed, falling back to agent defaults" in logs, experience unexpecte...
使用说明 (SKILL.md)

Cron Model Fix

Diagnose and fix OpenClaw cron job model override issues where configured models are rejected and fall back to agent defaults.

When to Use This Skill

Use when:

  • Cron jobs show "not allowed, falling back to agent defaults" in gateway logs
  • Unexpected cloud token burn on cron jobs configured with local models
  • Slow cron run times (60-180s) when local models should be used
  • Model overrides in cron jobs aren't being applied
  • Need to validate agent model allowlist configuration

Quick Start

# Diagnose the issue
openclaw skill run cron-model-fix --diagnose

# Apply the fix (adds missing models to allowlist)
openclaw skill run cron-model-fix --fix --model ollama/qwen3.5:0.8b

# Validate configuration
openclaw skill run cron-model-fix --validate

Root Cause

OpenClaw has three model configuration layers. ALL must include the model:

Layer 1: Provider Model Definition

Location: models.providers.\x3Cprovider>.models[] Purpose: Defines model specs (context, costs, capabilities)

Layer 2: Agent Default Model

Location: agents.defaults.model.primary Purpose: Default model when none specified

Layer 3: Agent Model Allowlist ← COMMON ISSUE

Location: agents.defaults.models Purpose: WHICH MODELS ARE PERMITTED for agent/cron use

Problem: Model exists in Layer 1, but missing from Layer 3 (allowlist).

Gateway logs show:

{"subsystem":"cron"}
"payload.model 'ollama/qwen3.5:0.8b' not allowed, falling back to agent defaults"

Diagnosis

Step 1: Check Gateway Logs

tail -100 /tmp/openclaw/openclaw-*.log | grep -i "not allowed\|falling back"

If you see: "payload.model '\x3Cmodel>' not allowed, falling back to agent defaults" → Model is missing from agent allowlist

Step 2: Check Agent Allowlist

cat ~/.openclaw/openclaw.json | python3 -c "
import json, sys
config = json.load(sys.stdin)
models = config.get('agents', {}).get('defaults', {}).get('models', {})
print('Allowed models:')
for model in models:
    print(f'  - {model}')
"

Check if your cron model is in the list. If not, it will be rejected.

Step 3: Check Cron Job Configuration

openclaw cron list

Verify:

  • Cron job has model specified in payload
  • Model format matches allowlist (e.g., ollama/qwen3.5:0.8b)

The Fix

Add the model to agents.defaults.models in ~/.openclaw/openclaw.json:

{
  "agents": {
    "defaults": {
      "model": {
        "primary": "ollama/qwen3.5:cloud",
        "fallbacks": [...]
      },
      "models": {
        "ollama/glm-4.7-flash": {},
        "ollama/kimi-k2.5:cloud": {},
        "ollama/qwen2.5vl:7b": {},
        "ollama/qwen3.5:397b-cloud": {},
        "ollama/qwen3.5:4b-32K": {},
        "ollama/qwen3.5:4b-32k": {},
        "ollama/qwen3.5:9b-128k": {},
        "ollama/qwen3.5:cloud": {},
        "ollama/qwen3.5:0.8b": {},  ← ADD THIS
        "ollama/qwen3.5:2b": {}     ← Optional
      }
    }
  }
}

Manual Fix Steps

  1. Edit config:

    nano ~/.openclaw/openclaw.json
    
  2. Add to agents.defaults.models:

    "ollama/qwen3.5:0.8b": {},
    
  3. Restart gateway:

    openclaw gateway restart
    
  4. Verify:

    openclaw cron runs --id \x3Cjob-id> --limit 3
    

    Look for "model": "qwen3.5:0.8b" instead of qwen3.5:cloud

Automated Fix Script

Use the included script:

python3 ~/.npm-global/lib/node_modules/openclaw/skills/cron-model-fix/scripts/add-model-allowlist.py --model ollama/qwen3.5:0.8b

Expected Results

Before Fix

Metric Value
Model Cloud fallback
Duration 60-180 seconds
Input Tokens 200K-600K per run
Cost Cloud token burn

After Fix

Metric Value Improvement
Model Local (e.g., qwen3.5:0.8b) ✅ Free
Duration 1-13 seconds 5-14x faster
Input Tokens 5K-36K 85-95% reduction
Cost ZERO 100% savings

Validation

After applying fix, verify:

# Check for model rejection warnings
tail -50 /tmp/openclaw/openclaw-*.log | grep -i "not allowed"

# Should be EMPTY (no warnings)
# Check cron run history
openclaw cron runs --id \x3Cjob-id> --limit 1

# Should show:
# "model": "qwen3.5:0.8b" (not cloud)
# "durationMs": \x3C15000 (fast)
# "input_tokens": \x3C50000 (low)

Common Issues

Issue: Model still not working after fix

Check:

  1. Gateway restarted after config change?
  2. Model format matches exactly? (e.g., ollama/qwen3.5:0.8b vs qwen3.5:0.8b)
  3. Model exists in provider config (Layer 1)?

Issue: Invalid JSON after editing

Fix:

openclaw doctor --fix

Or restore from backup:

cp ~/.openclaw/openclaw.json.backup ~/.openclaw/openclaw.json

Related Skills

  • inbox-optimizer - Optimizes inbox scanning patterns (mesh-specific)
  • healthcheck - General OpenClaw system health monitoring

References

  • See references/model-config-layers.md for detailed configuration structure
  • See references/troubleshooting-examples.md for real-world case studies

Version

1.0.0 - Initial release (2026-03-30)

安全使用建议
This skill appears to do exactly what it says: check logs and add a model entry to your ~/.openclaw/openclaw.json allowlist. Before running it: (1) inspect the SKILL.md and the add-model-allowlist.py script to confirm it will modify only ~/.openclaw/openclaw.json, (2) run the script with --dry-run or --backup to preserve your config, (3) ensure you trust the openclaw CLI on your system (the skill calls openclaw gateway/cron commands), and (4) validate the config and restart the gateway only after confirming the JSON is correct.
功能分析
Type: OpenClaw Skill Name: cron-model-fix Version: 1.0.0 The skill bundle is designed to diagnose and fix a specific configuration issue in OpenClaw where cron jobs fail to use specified models due to allowlist restrictions. The included Python script (scripts/add-model-allowlist.py) safely modifies the local configuration file (~/.openclaw/openclaw.json) after creating a backup, and the documentation (SKILL.md and references/model-config-layers.md) accurately describes the system's behavior without any signs of malicious intent or data exfiltration.
能力评估
Purpose & Capability
The name/description (fixing agent model allowlist for cron jobs) match the provided instructions and the included script. No unrelated credentials, binaries, or services are requested.
Instruction Scope
SKILL.md only instructs checking logs, inspecting/editing ~/.openclaw/openclaw.json, running openclaw CLI commands, and optionally running the included add-model-allowlist.py script. These actions are directly related to the stated task and do not collect or transmit unrelated data.
Install Mechanism
No install spec is present (instruction-only with a helper script). There are no downloads from external URLs or unusual install locations. The included script is a simple local Python utility.
Credentials
The skill requires no environment variables or external credentials. The script operates only on the user's ~/.openclaw/openclaw.json (config file) and creates a local backup; this is proportionate to the task.
Persistence & Privilege
The skill does not request persistent or elevated platform privileges (always is false). It modifies only the OpenClaw config file under the user's home and instructs the user to restart the gateway—behavior consistent with its stated purpose.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install cron-model-fix
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /cron-model-fix 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release - Fixes OpenClaw cron model override issues. 180x speedup, 99.9% token reduction.
元数据
Slug cron-model-fix
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Cron Model Fix 是什么?

Diagnose and fix OpenClaw cron job model override issues. Use when cron jobs show "not allowed, falling back to agent defaults" in logs, experience unexpecte... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 98 次。

如何安装 Cron Model Fix?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install cron-model-fix」即可一键安装,无需额外配置。

Cron Model Fix 是免费的吗?

是的,Cron Model Fix 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Cron Model Fix 支持哪些平台?

Cron Model Fix 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Cron Model Fix?

由 mklue(@mklue)开发并维护,当前版本 v1.0.0。

💬 留言讨论