fix(cronjob): add schedule and job_id to JSON schema required array - #49792
fix(cronjob): add schedule and job_id to JSON schema required array#49792tcconnally wants to merge 2 commits into
Conversation
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
|
Thanks for this — closing in favor of #53246, which fixes the same root cause (#34120) at the handler boundary. The schema- #53246 instead coalesces the common schedule synonyms some models emit ( Appreciate you digging into this one. |
Summary
The cronjob tool schema declared only
actionasrequired, butscheduleis needed foraction=createandjob_idis needed foraction=update/pause/resume/remove/run. Strict JSON-schema-compliant models may omit parameters that are absent from therequiredarray, 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.pyline 853 had:Both
scheduleandjob_idwere described as required for specific actions in the parameter descriptions but NOT in the JSON schema'srequiredarray. Models that strictly honor the JSON schema structure may skip them.Fix
Added
scheduleandjob_idto therequiredarray:This is safe for non-applicable actions:
scheduleis only checked whenaction=create(line 504)job_idis only checked for update/pause/resume/remove/run (line 585)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
requiredarray rather than description text. Other tools with similar patterns should be audited for the same gap.Closes #49695