Skip to content

fix(cron): clarify schedule is required for create in tool schema#32804

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-a7c5e76d
May 26, 2026
Merged

fix(cron): clarify schedule is required for create in tool schema#32804
teknium1 merged 2 commits into
mainfrom
hermes/hermes-a7c5e76d

Conversation

@teknium1

@teknium1 teknium1 commented May 26, 2026

Copy link
Copy Markdown
Contributor

Salvage of #32448. Tells description-driven models (Grok) that schedule is required when action=create, so they stop looping on the schedule is required for create validator (issue #32427).

Changes

  • tools/cronjob_tools.py: action and schedule descriptions now explicitly say REQUIRED for action=create, with concrete examples. (+2/-2)
  • tests/cron/test_cronjob_schema.py: guard the description text + assert required[] stays ["action"] so we don't regress the create-only conditional.

Dropped from the original PR

The contributor's second commit added a JSON-Schema if/then block. Dropped it: Gemini's allowlist drops unknown keywords, Anthropic doesn't enforce if/then (and doesn't strip it either — harmless but inert), and xAI/Grok itself was already ignoring the schema (which is why this bug exists). The description text is the layer that actually moves Grok. Keeping the diff minimal.

Validation

scripts/run_tests.sh tests/cron/ — 386/386 passing.

Credits @ygd58 — original commit cherry-picked with authorship preserved.

Closes #32427
Closes #32448

Infographic

cronjob-schedule-fix

ygd58 and others added 2 commits May 26, 2026 13:39
Grok models (and other LLMs) sometimes omit the schedule parameter
when calling the cronjob tool with action=create because the schema
only listed 'action' in required[] and the schedule description did
not explicitly state it was mandatory (issue #32427).

Fix: update schema descriptions to clearly state schedule is REQUIRED
for action=create, making this explicit for models that rely on
description text for parameter compliance.

Fixes #32427
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-a7c5e76d vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 9373 on HEAD, 9361 on base (🆕 +12)

🆕 New issues (9):

Rule Count
invalid-argument-type 6
unsupported-operator 3
First entries
tests/cron/test_cronjob_schema.py:16: [invalid-argument-type] invalid-argument-type: Method `__getitem__` of type `Overload[(i: SupportsIndex, /) -> str, (s: slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[str]]` cannot be called with key of type `Literal["action"]` on object of type `list[str]`
tests/cron/test_cronjob_schema.py:41: [invalid-argument-type] invalid-argument-type: Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["required"]` on object of type `str`
tests/cron/test_cronjob_schema.py:26: [invalid-argument-type] invalid-argument-type: Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["schedule"]` on object of type `str`
tests/cron/test_cronjob_schema.py:27: [unsupported-operator] unsupported-operator: Operator `in` is not supported between objects of type `Literal["REQUIRED"]` and `Unknown | str | dict[str, str] | ... omitted 3 union elements`
tests/cron/test_cronjob_schema.py:28: [unsupported-operator] unsupported-operator: Operator `in` is not supported between objects of type `Literal["action=create"]` and `Unknown | str | dict[str, str] | ... omitted 3 union elements`
tests/cron/test_cronjob_schema.py:18: [unsupported-operator] unsupported-operator: Operator `in` is not supported between objects of type `Literal["schedule"]` and `Unknown | str | dict[str, str] | ... omitted 3 union elements`
tests/cron/test_cronjob_schema.py:26: [invalid-argument-type] invalid-argument-type: Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["properties"]` on object of type `str`
tests/cron/test_cronjob_schema.py:16: [invalid-argument-type] invalid-argument-type: Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["action"]` on object of type `str`
tests/cron/test_cronjob_schema.py:26: [invalid-argument-type] invalid-argument-type: Method `__getitem__` of type `Overload[(i: SupportsIndex, /) -> str, (s: slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[str]]` cannot be called with key of type `Literal["schedule"]` on object of type `list[str]`

✅ Fixed issues: none

Unchanged: 4958 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@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 26, 2026
@teknium1 teknium1 merged commit 556bf7c into main May 26, 2026
26 checks passed
@teknium1 teknium1 deleted the hermes/hermes-a7c5e76d branch May 26, 2026 21:09
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