Skip to content

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

@atdy

Description

@atdy

Description

Bug Description

Cron jobs fail with HTTP 400 error "Model parameter is required" when the job does not have an explicit model field set, even though config.yaml has a valid model.default configured.

Steps to Reproduce

  1. Ensure ~/.hermes/config.yaml has:
    model:
      default: kimi-k2.6
      provider: kimi-for-coding
  2. Create a cron job without explicitly setting model:
    hermes cron create --name test --prompt "say hi" --schedule "0 * * * *"
  3. Wait for the job to run (or trigger manually).
  4. Job fails with:
    RuntimeError: Error code: 400 - {'status': 400, 'message': 'Model parameter is required'}
    

Expected Behavior

Cron scheduler should fall back to model.default from config.yaml when the job has no explicit model override, matching the behavior of gateway and CLI sessions.

Actual Behavior

Job fails because an empty/invalid model is passed to the API provider.

Environment

  • Hermes Version: v0.16.0 (2026.6.5) · upstream 5d8c44a
  • OS: Ubuntu 24.04
  • Python: 3.11.15
  • Provider: kimi-for-coding
  • OpenAI SDK: 2.24.0

Relevant Code

In cron/scheduler.py (~line 1626):

model = job.get("model") or os.getenv("HERMES_MODEL") or ""

The fallback to config.yaml model happens later (~line 1638-1642), but it appears the resolved model may still be empty when passed to AIAgent in some code paths.

Workaround

Explicitly set model on each cron job:

hermes cron edit <job_id> --model kimi-k2.6

Related Issues


Reported by user experiencing this on two separate cron jobs after upgrading to v0.16.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High — major feature broken, no workaroundcomp/cronCron scheduler and job managementtype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions