fix(cron): recover flat params when LLM omits job wrapper#12124
Merged
fix(cron): recover flat params when LLM omits job wrapper#12124
Conversation
tyler6204
added a commit
that referenced
this pull request
Feb 9, 2026
tyler6204
added a commit
that referenced
this pull request
Feb 9, 2026
5683066 to
2fc658d
Compare
Non-frontier models (e.g. Grok) flatten job properties to the top level
alongside `action` instead of nesting them inside the `job` parameter.
The opaque schema (`Type.Object({}, { additionalProperties: true })`)
gives these models no structural hint, so they put name, schedule,
payload, etc. as siblings of action.
Add a flat-params recovery step in the cron add handler: when
`params.job` is missing or an empty object, scan for recognised job
property names on params and construct a synthetic job object before
passing to `normalizeCronJobCreate`. Recovery requires at least one
meaningful signal field (schedule, payload, message, or text) to avoid
false positives.
Added tests:
- Flat params with no job wrapper → recovered
- Empty job object + flat params → recovered
- Message shorthand at top level → inferred as agentTurn
- No meaningful fields → still throws 'job required'
- Non-empty job takes precedence over flat params
Cron expressions operate at second granularity. When nowMs falls mid-second (e.g. 12:00:00.500) and the pattern targets that exact second (like '0 0 12 * * *'), a 1ms lookback still lands inside the matching second. Croner interprets this as 'already past' and skips to the next occurrence (e.g. the following day). Fix: floor nowMs to the start of the current second before applying the 1ms lookback. This ensures the reference always falls in the *previous* second, so croner correctly identifies the current match. Also compare the result against the floored nowSecondMs (not raw nowMs) so that a match at the start of the current second is not rejected by the >= guard when nowMs has sub-second offset. Adds regression tests for 6-field cron patterns with specific seconds.
2fc658d to
03f3c74
Compare
Member
Author
|
Merged via squash.
Thanks @tyler6204! |
This was referenced Feb 9, 2026
2 tasks
yeboster
pushed a commit
to yeboster/openclaw
that referenced
this pull request
Feb 9, 2026
…2124) * fix(cron): recover flat params when LLM omits job wrapper (openclaw#11310) Non-frontier models (e.g. Grok) flatten job properties to the top level alongside `action` instead of nesting them inside the `job` parameter. The opaque schema (`Type.Object({}, { additionalProperties: true })`) gives these models no structural hint, so they put name, schedule, payload, etc. as siblings of action. Add a flat-params recovery step in the cron add handler: when `params.job` is missing or an empty object, scan for recognised job property names on params and construct a synthetic job object before passing to `normalizeCronJobCreate`. Recovery requires at least one meaningful signal field (schedule, payload, message, or text) to avoid false positives. Added tests: - Flat params with no job wrapper → recovered - Empty job object + flat params → recovered - Message shorthand at top level → inferred as agentTurn - No meaningful fields → still throws 'job required' - Non-empty job takes precedence over flat params * fix(cron): floor nowMs to second boundary before croner lookback Cron expressions operate at second granularity. When nowMs falls mid-second (e.g. 12:00:00.500) and the pattern targets that exact second (like '0 0 12 * * *'), a 1ms lookback still lands inside the matching second. Croner interprets this as 'already past' and skips to the next occurrence (e.g. the following day). Fix: floor nowMs to the start of the current second before applying the 1ms lookback. This ensures the reference always falls in the *previous* second, so croner correctly identifies the current match. Also compare the result against the floored nowSecondMs (not raw nowMs) so that a match at the start of the current second is not rejected by the >= guard when nowMs has sub-second offset. Adds regression tests for 6-field cron patterns with specific seconds. * fix: add changelog entries for cron fixes (openclaw#12124) (thanks @tyler6204) * test: stabilize warning filter emit assertion (openclaw#12124) (thanks @tyler6204)
NikolasP98
pushed a commit
to NikolasP98/openclaw
that referenced
this pull request
Feb 9, 2026
…2124) * fix(cron): recover flat params when LLM omits job wrapper (openclaw#11310) Non-frontier models (e.g. Grok) flatten job properties to the top level alongside `action` instead of nesting them inside the `job` parameter. The opaque schema (`Type.Object({}, { additionalProperties: true })`) gives these models no structural hint, so they put name, schedule, payload, etc. as siblings of action. Add a flat-params recovery step in the cron add handler: when `params.job` is missing or an empty object, scan for recognised job property names on params and construct a synthetic job object before passing to `normalizeCronJobCreate`. Recovery requires at least one meaningful signal field (schedule, payload, message, or text) to avoid false positives. Added tests: - Flat params with no job wrapper → recovered - Empty job object + flat params → recovered - Message shorthand at top level → inferred as agentTurn - No meaningful fields → still throws 'job required' - Non-empty job takes precedence over flat params * fix(cron): floor nowMs to second boundary before croner lookback Cron expressions operate at second granularity. When nowMs falls mid-second (e.g. 12:00:00.500) and the pattern targets that exact second (like '0 0 12 * * *'), a 1ms lookback still lands inside the matching second. Croner interprets this as 'already past' and skips to the next occurrence (e.g. the following day). Fix: floor nowMs to the start of the current second before applying the 1ms lookback. This ensures the reference always falls in the *previous* second, so croner correctly identifies the current match. Also compare the result against the floored nowSecondMs (not raw nowMs) so that a match at the start of the current second is not rejected by the >= guard when nowMs has sub-second offset. Adds regression tests for 6-field cron patterns with specific seconds. * fix: add changelog entries for cron fixes (openclaw#12124) (thanks @tyler6204) * test: stabilize warning filter emit assertion (openclaw#12124) (thanks @tyler6204)
NikolasP98
added a commit
to NikolasP98/openclaw
that referenced
this pull request
Feb 9, 2026
Integrated upstream improvements: - CRITICAL: Fix bundled hooks broken since 2026.2.2 (openclaw#9295) - Grok web search provider (xAI) with inline citations - Telegram video note support with tests and docs - QMD model cache sharing optimization (openclaw#12114) - Context overflow false positive fix (openclaw#2078) - Model failover 400 status handling (openclaw#1879) - Dynamic config loading per-message (openclaw#11372) - Gateway post-compaction amnesia fix (openclaw#12283) - Skills watcher: ignore Python venvs and caches - Telegram send recovery from stale thread IDs - Cron job parameter recovery (openclaw#12124) - Auto-reply weekday timestamps (openclaw#12438) - Utility consolidation refactoring (PNG, JSON, errors) - Cross-platform test normalization (openclaw#12212) - macOS Nix defaults support (openclaw#12205) Preserved DEV enhancements: - Docker multi-stage build with enhanced tooling (gh, gog, obsidian-cli, uv, nano-pdf, mcporter, qmd) - Comprehensive .env.example documentation (371 lines) - Multi-environment docker-compose support (DEV/PRD) - GOG/Tailscale integration - Fork-sync and openclaw-docs skills - UI config editor (Svelte) - Fork workflow documentation Merge strategy: Cherry-picked 22 upstream commits, preserved DEV Docker architecture. Docker files unchanged: Dockerfile, docker-compose.yml, docker-setup.sh, .env.example Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Ethermious
pushed a commit
to Ethermious/openclaw
that referenced
this pull request
Feb 9, 2026
…2124) * fix(cron): recover flat params when LLM omits job wrapper (openclaw#11310) Non-frontier models (e.g. Grok) flatten job properties to the top level alongside `action` instead of nesting them inside the `job` parameter. The opaque schema (`Type.Object({}, { additionalProperties: true })`) gives these models no structural hint, so they put name, schedule, payload, etc. as siblings of action. Add a flat-params recovery step in the cron add handler: when `params.job` is missing or an empty object, scan for recognised job property names on params and construct a synthetic job object before passing to `normalizeCronJobCreate`. Recovery requires at least one meaningful signal field (schedule, payload, message, or text) to avoid false positives. Added tests: - Flat params with no job wrapper → recovered - Empty job object + flat params → recovered - Message shorthand at top level → inferred as agentTurn - No meaningful fields → still throws 'job required' - Non-empty job takes precedence over flat params * fix(cron): floor nowMs to second boundary before croner lookback Cron expressions operate at second granularity. When nowMs falls mid-second (e.g. 12:00:00.500) and the pattern targets that exact second (like '0 0 12 * * *'), a 1ms lookback still lands inside the matching second. Croner interprets this as 'already past' and skips to the next occurrence (e.g. the following day). Fix: floor nowMs to the start of the current second before applying the 1ms lookback. This ensures the reference always falls in the *previous* second, so croner correctly identifies the current match. Also compare the result against the floored nowSecondMs (not raw nowMs) so that a match at the start of the current second is not rejected by the >= guard when nowMs has sub-second offset. Adds regression tests for 6-field cron patterns with specific seconds. * fix: add changelog entries for cron fixes (openclaw#12124) (thanks @tyler6204) * test: stabilize warning filter emit assertion (openclaw#12124) (thanks @tyler6204)
lucasmpramos
pushed a commit
to butley/openclaw
that referenced
this pull request
Feb 10, 2026
…2124) * fix(cron): recover flat params when LLM omits job wrapper (openclaw#11310) Non-frontier models (e.g. Grok) flatten job properties to the top level alongside `action` instead of nesting them inside the `job` parameter. The opaque schema (`Type.Object({}, { additionalProperties: true })`) gives these models no structural hint, so they put name, schedule, payload, etc. as siblings of action. Add a flat-params recovery step in the cron add handler: when `params.job` is missing or an empty object, scan for recognised job property names on params and construct a synthetic job object before passing to `normalizeCronJobCreate`. Recovery requires at least one meaningful signal field (schedule, payload, message, or text) to avoid false positives. Added tests: - Flat params with no job wrapper → recovered - Empty job object + flat params → recovered - Message shorthand at top level → inferred as agentTurn - No meaningful fields → still throws 'job required' - Non-empty job takes precedence over flat params * fix(cron): floor nowMs to second boundary before croner lookback Cron expressions operate at second granularity. When nowMs falls mid-second (e.g. 12:00:00.500) and the pattern targets that exact second (like '0 0 12 * * *'), a 1ms lookback still lands inside the matching second. Croner interprets this as 'already past' and skips to the next occurrence (e.g. the following day). Fix: floor nowMs to the start of the current second before applying the 1ms lookback. This ensures the reference always falls in the *previous* second, so croner correctly identifies the current match. Also compare the result against the floored nowSecondMs (not raw nowMs) so that a match at the start of the current second is not rejected by the >= guard when nowMs has sub-second offset. Adds regression tests for 6-field cron patterns with specific seconds. * fix: add changelog entries for cron fixes (openclaw#12124) (thanks @tyler6204) * test: stabilize warning filter emit assertion (openclaw#12124) (thanks @tyler6204)
slathrop
referenced
this pull request
in slathrop/openclaw-js
Feb 11, 2026
- Add flat-params recovery in cron add handler for non-frontier models - Floor nowMs to second boundary before croner lookback (off-by-one fix) - Add tests for flat params recovery (5 cases) - Add 6-field cron pattern tests for schedule second-floor fix - Stabilize warning-filter emit assertion timing (spy emitWarning not stderr)
yeboster
pushed a commit
to yeboster/openclaw
that referenced
this pull request
Feb 13, 2026
…2124) * fix(cron): recover flat params when LLM omits job wrapper (openclaw#11310) Non-frontier models (e.g. Grok) flatten job properties to the top level alongside `action` instead of nesting them inside the `job` parameter. The opaque schema (`Type.Object({}, { additionalProperties: true })`) gives these models no structural hint, so they put name, schedule, payload, etc. as siblings of action. Add a flat-params recovery step in the cron add handler: when `params.job` is missing or an empty object, scan for recognised job property names on params and construct a synthetic job object before passing to `normalizeCronJobCreate`. Recovery requires at least one meaningful signal field (schedule, payload, message, or text) to avoid false positives. Added tests: - Flat params with no job wrapper → recovered - Empty job object + flat params → recovered - Message shorthand at top level → inferred as agentTurn - No meaningful fields → still throws 'job required' - Non-empty job takes precedence over flat params * fix(cron): floor nowMs to second boundary before croner lookback Cron expressions operate at second granularity. When nowMs falls mid-second (e.g. 12:00:00.500) and the pattern targets that exact second (like '0 0 12 * * *'), a 1ms lookback still lands inside the matching second. Croner interprets this as 'already past' and skips to the next occurrence (e.g. the following day). Fix: floor nowMs to the start of the current second before applying the 1ms lookback. This ensures the reference always falls in the *previous* second, so croner correctly identifies the current match. Also compare the result against the floored nowSecondMs (not raw nowMs) so that a match at the start of the current second is not rejected by the >= guard when nowMs has sub-second offset. Adds regression tests for 6-field cron patterns with specific seconds. * fix: add changelog entries for cron fixes (openclaw#12124) (thanks @tyler6204) * test: stabilize warning filter emit assertion (openclaw#12124) (thanks @tyler6204)
skyhawk14
pushed a commit
to skyhawk14/openclaw
that referenced
this pull request
Feb 13, 2026
…2124) * fix(cron): recover flat params when LLM omits job wrapper (openclaw#11310) Non-frontier models (e.g. Grok) flatten job properties to the top level alongside `action` instead of nesting them inside the `job` parameter. The opaque schema (`Type.Object({}, { additionalProperties: true })`) gives these models no structural hint, so they put name, schedule, payload, etc. as siblings of action. Add a flat-params recovery step in the cron add handler: when `params.job` is missing or an empty object, scan for recognised job property names on params and construct a synthetic job object before passing to `normalizeCronJobCreate`. Recovery requires at least one meaningful signal field (schedule, payload, message, or text) to avoid false positives. Added tests: - Flat params with no job wrapper → recovered - Empty job object + flat params → recovered - Message shorthand at top level → inferred as agentTurn - No meaningful fields → still throws 'job required' - Non-empty job takes precedence over flat params * fix(cron): floor nowMs to second boundary before croner lookback Cron expressions operate at second granularity. When nowMs falls mid-second (e.g. 12:00:00.500) and the pattern targets that exact second (like '0 0 12 * * *'), a 1ms lookback still lands inside the matching second. Croner interprets this as 'already past' and skips to the next occurrence (e.g. the following day). Fix: floor nowMs to the start of the current second before applying the 1ms lookback. This ensures the reference always falls in the *previous* second, so croner correctly identifies the current match. Also compare the result against the floored nowSecondMs (not raw nowMs) so that a match at the start of the current second is not rejected by the >= guard when nowMs has sub-second offset. Adds regression tests for 6-field cron patterns with specific seconds. * fix: add changelog entries for cron fixes (openclaw#12124) (thanks @tyler6204) * test: stabilize warning filter emit assertion (openclaw#12124) (thanks @tyler6204)
mbelinky
pushed a commit
that referenced
this pull request
Feb 14, 2026
* fix(cron): recover flat params when LLM omits job wrapper (#11310) Non-frontier models (e.g. Grok) flatten job properties to the top level alongside `action` instead of nesting them inside the `job` parameter. The opaque schema (`Type.Object({}, { additionalProperties: true })`) gives these models no structural hint, so they put name, schedule, payload, etc. as siblings of action. Add a flat-params recovery step in the cron add handler: when `params.job` is missing or an empty object, scan for recognised job property names on params and construct a synthetic job object before passing to `normalizeCronJobCreate`. Recovery requires at least one meaningful signal field (schedule, payload, message, or text) to avoid false positives. Added tests: - Flat params with no job wrapper → recovered - Empty job object + flat params → recovered - Message shorthand at top level → inferred as agentTurn - No meaningful fields → still throws 'job required' - Non-empty job takes precedence over flat params * fix(cron): floor nowMs to second boundary before croner lookback Cron expressions operate at second granularity. When nowMs falls mid-second (e.g. 12:00:00.500) and the pattern targets that exact second (like '0 0 12 * * *'), a 1ms lookback still lands inside the matching second. Croner interprets this as 'already past' and skips to the next occurrence (e.g. the following day). Fix: floor nowMs to the start of the current second before applying the 1ms lookback. This ensures the reference always falls in the *previous* second, so croner correctly identifies the current match. Also compare the result against the floored nowSecondMs (not raw nowMs) so that a match at the start of the current second is not rejected by the >= guard when nowMs has sub-second offset. Adds regression tests for 6-field cron patterns with specific seconds. * fix: add changelog entries for cron fixes (#12124) (thanks @tyler6204) * test: stabilize warning filter emit assertion (#12124) (thanks @tyler6204)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Closes #11310.
Non-frontier models (e.g. Grok) flatten job properties to the top level alongside
actioninstead of nesting them inside thejobparameter. The cron tool'saddhandler schema uses an opaqueType.Object({}, { additionalProperties: true })forjob, giving these models no structural hint — so they placename,schedule,payload,sessionTarget, etc. as siblings ofaction.This causes either:
Error('job required')whenparams.jobisundefinedparams.jobis{}and the actual fields are ignored at the top levelFix
Added a flat-params recovery step at the top of the
case 'add':handler insrc/agents/tools/cron-tool.ts:params.jobis missing or an empty object, scanparamsfor recognised job property names (name,schedule,payload,sessionTarget,enabled,message,text,model,thinking, etc.)schedule,payload,message, ortext), construct a syntheticjobobject from those fieldsnormalizeCronJobCreatepath which handles kind inference, defaults, and validationIf
params.jobalready contains properties, the existing behavior is completely unchanged.Tests
Added 5 test cases covering:
jobwrapper → recovered successfullyjob: {}+ flat params → recovered successfullyagentTurnpayload'job required'jobtakes precedence over flat paramsGreptile Overview
Greptile Summary
This PR updates the cron tool’s
addhandler to recover from “flat” LLM tool params where job fields (e.g.name,schedule,payload) are provided at the top level instead of underjob. Whenparams.jobis missing or{}, it reconstructs a syntheticjobfrom recognized keys (only if there’s a clear signal likeschedule/payload/message/text) and then proceeds through the existingnormalizeCronJobCreatepath. The change is covered by 5 new tests validating recovery, shorthand message inference, the “no signal” error path, and that a non-empty nestedjobcontinues to take precedence.Confidence Score: 5/5
addpath, gated to only run whenparams.jobis missing or empty, and further gated on strong intent signals (schedule/payload/message/text). Existing behavior for non-emptyjobis preserved, and new unit tests cover the main recovery and precedence cases. No broader code paths or schemas are modified.Context used:
dashboard- CLAUDE.md (source)dashboard- AGENTS.md (source)