Skip to content

fix(cron): report missing default model clearly#46072

Open
szzhoujiarui-sketch wants to merge 1 commit into
NousResearch:mainfrom
szzhoujiarui-sketch:260614-fix-cron-empty-model-error
Open

fix(cron): report missing default model clearly#46072
szzhoujiarui-sketch wants to merge 1 commit into
NousResearch:mainfrom
szzhoujiarui-sketch:260614-fix-cron-empty-model-error

Conversation

@szzhoujiarui-sketch

Copy link
Copy Markdown

What does this PR do?

Cron jobs can currently fall through to provider execution with an empty model when config.yaml has a model: section but omits model.default. That produces a lower-level provider/API error that is harder to diagnose.

This PR makes the cron path fail before starting AIAgent when no job model, HERMES_MODEL, or model.default resolves to a non-empty model. The error now points directly at the missing cron model configuration.

Related Issue

Fixes #43899

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Security fix
  • Documentation update
  • Tests (adding or improving test coverage)
  • Refactor (no behavior change)
  • New skill (bundled or hub)

Changes Made

  • cron/scheduler.py: detect the explicit model: dict-without-default case and return a clear Hermes-side error before agent startup.
  • tests/cron/test_scheduler.py: add coverage that the missing default model path fails early and does not instantiate AIAgent.

How to Test

  1. Configure a cron job without a job-level model.
  2. Use a config.yaml with model.provider set and no model.default.
  3. Run the cron job and confirm it fails with No model resolved for cron job... before the provider call.

Tested locally:

scripts/run_tests.sh tests/cron/test_scheduler.py
python3 -m py_compile cron/scheduler.py tests/cron/test_scheduler.py
git diff --check

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Linux

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — N/A

Screenshots / Logs

Focused test result:

137 tests passed, 0 failed

Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com>
@alt-glitch alt-glitch added type/bug Something isn't working comp/cron Cron scheduler and job management P3 Low — cosmetic, nice to have labels Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cron Cron scheduler and job management P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Cron jobs fail with 'Model parameter is required' when model is not explicitly set on the job

3 participants