Skip to content

fix(cronjob): add schedule and job_id to JSON schema required array - #49792

Closed
tcconnally wants to merge 2 commits into
NousResearch:mainfrom
Perseus-Computing-LLC:fix/cronjob-required-params-49695
Closed

fix(cronjob): add schedule and job_id to JSON schema required array#49792
tcconnally wants to merge 2 commits into
NousResearch:mainfrom
Perseus-Computing-LLC:fix/cronjob-required-params-49695

Conversation

@tcconnally

Copy link
Copy Markdown
Contributor

Summary

The cronjob tool schema declared only action as required, but schedule is needed for action=create and job_id is needed for action=update/pause/resume/remove/run. Strict JSON-schema-compliant models may omit parameters that are absent from the required array, causing the tool to return "schedule is required for create" even when the LLM read the description text and wanted to include it.

Root Cause

The schema at tools/cronjob_tools.py line 853 had:

"required": ["action"]

Both schedule and job_id were described as required for specific actions in the parameter descriptions but NOT in the JSON schema's required array. Models that strictly honor the JSON schema structure may skip them.

Fix

Added schedule and job_id to the required array:

"required": ["action", "schedule", "job_id"]

This is safe for non-applicable actions:

  • schedule is only checked when action=create (line 504)
  • job_id is only checked for update/pause/resume/remove/run (line 585)
  • All other actions silently ignore irrelevant parameters

Pattern

This is a class-level fix — any multi-action tool with conditionally-required parameters can hit this when models hew to the JSON schema required array rather than description text. Other tools with similar patterns should be audited for the same gap.

Closes #49695

The cronjob tool schema declared only 'action' as required, but
'schedule' is needed for create and 'job_id' for update/pause/resume/
remove/run. Strict JSON-schema-compliant models may omit parameters
absent from the required array, causing 'schedule is required for
create' even when the description text specifies it.

Adding both to required ensures all models include them. The function
body handles non-applicable actions gracefully.

Closes #49695
@alt-glitch alt-glitch added type/bug Something isn't working comp/cron Cron scheduler and job management P1 High — major feature broken, no workaround labels Jun 20, 2026
@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-massive Sweeper blast radius: massive — everyone, every turn (invariant surface) labels Jun 21, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for this — closing in favor of #53246, which fixes the same root cause (#34120) at the handler boundary.

The schema-required approach here would over-constrain the tool: schedule and job_id are action-specific, not globally required. list, remove, pause, resume, and run don't take a schedule, and create doesn't take a job_id — adding both to the global required array would reject every one of those calls. (Gille flagged the same thing in the support thread.)

#53246 instead coalesces the common schedule synonyms some models emit (cron, when, cron_expression, …) onto the canonical key at the dispatch boundary, with canonical always winning and empty-string falling through to aliases. That lets create succeed without changing what's required per action.

Appreciate you digging into this one.

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 P1 High — major feature broken, no workaround sweeper:blast-massive Sweeper blast radius: massive — everyone, every turn (invariant surface) sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: cronjob tool create action fails with 'schedule is required for create' (v0.17.0)

3 participants