Skip to content

fix(cron): add schedule to required array in CRONJOB_SCHEMA - #33980

Closed
jinnkhan88 wants to merge 1 commit into
NousResearch:mainfrom
jinnkhan88:fix/cronjob-required-schedule
Closed

fix(cron): add schedule to required array in CRONJOB_SCHEMA#33980
jinnkhan88 wants to merge 1 commit into
NousResearch:mainfrom
jinnkhan88:fix/cronjob-required-schedule

Conversation

@jinnkhan88

Copy link
Copy Markdown

Grok models ignore prose descriptions and only respect the machine-readable required field in JSON Schema. The prior fix (5101326) clarified the description text but did not add schedule to required[], so grok-4.3 still omits it on action=create, causing an infinite loop of "schedule is required for create" errors.

Fix: Add "schedule" to the required array. Safe because the handler only checks schedule for action=create and ignores it for other actions.

Fixes #32427

Grok models ignore prose descriptions and only respect the
machine-readable required field. The prior fix (5101326) clarified
the description text but did not add schedule to required[], so
grok-4.3 still omits it on action=create.

Fixes NousResearch#32427
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cron Cron scheduler and job management provider/xai xAI (Grok) labels May 28, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of merged #32804 (by teknium1, salvage of #32448). The schedulerequired schema fix is already shipped on main. Ref: #32427 (original issue, closed).

@teknium1

Copy link
Copy Markdown
Contributor

Closing — conflicts with a deliberate prior design decision.

PR #32448 (commit 51013268c, which you reference) landed the prose-description fix for #32427 and intentionally kept required[] at ["action"] only. The rationale is documented as a regression test at tests/cron/test_cronjob_schema.py:31 (test_cronjob_schema_required_array_unchanged):

The schema intentionally does NOT promote schedule/prompt into the top-level required array because they're only mandatory for action=create, not for list/remove/pause/etc. The description text carries the conditional requirement instead.

The trade-off you'd be making:

Today Post-PR
Grok action=create without schedule Occasionally happens → runtime error → retry Grok always emits schedule ✓
Grok action=list/remove/pause/resume/run Schedule omitted (correct) Grok emits bogus schedule (silently ignored by handler)
Claude / GPT / other compliant models Schedule omitted on non-create (correct) Forced to invent bogus schedule on every action
The regression test Passes Fails (the PR breaks it without updating it)

The honest answer to "when would we ever want to say schedule is required for action=list?" is never — and the schema shouldn't say so. If Grok ignores the prose, the answer is to harden the prose (stronger wording, more explicit conditional phrasing, possibly restructure the action description to enumerate required fields per action), not to mark schedule globally required.

A productive follow-up would be: empirically test which prose forms Grok actually respects — e.g. moving the conditional-required hint earlier in the action field's description, or adding a per-action required-fields breakdown. Issue #32427 has volume so it's worth solving; this just isn't the right intervention point.

Closing without prejudice — thanks for engaging with a real bug. If you want to revisit with a prose-only tightening, happy to look at that.

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 provider/xai xAI (Grok) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cronjob tool fails to include required schedule parameter when using Grok models

3 participants