fix(cron): accept null fallbacks in update patch payload (#100707)#100801
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 6, 2026, 9:13 AM ET / 13:13 UTC. Summary PR surface: Source +6, Tests +36. Total +42 across 8 files. Reproducibility: yes. Source inspection shows current main and Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Land this narrow cron tool schema fix after ordinary maintainer review, keeping create/config schemas strict while reusing the existing protocol and service null-clear behavior. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main and Is this the best way to solve the issue? Yes. This PR fixes the exact TypeBox cron tool patch schema gate and adds focused runtime schema coverage, rather than broadening config schemas or changing service code that already supports null clears. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5aa7c6267cc0. Label changesLabel justifications:
Evidence reviewedPR surface: Source +6, Tests +36. Total +42 across 8 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
b02c8d4 to
1b84c39
Compare
createCronPatchObjectSchema passes nullableStringArraySchema for model and toolsAllow, but fallbacks was still hardcoded as a non-nullable array in cronPayloadObjectSchema, rejecting null clears before they reach the Gateway service layer. Switch fallbacks to a parameter so the patch context can pass the nullable variant, matching the existing pattern for model and toolsAllow. Fixes openclaw#100707 Co-Authored-By: Claude <[email protected]>
1b84c39 to
c2d0962
Compare
…0707) (openclaw#100801) * fix(cron): accept null fallbacks in cron update patch payload createCronPatchObjectSchema passes nullableStringArraySchema for model and toolsAllow, but fallbacks was still hardcoded as a non-nullable array in cronPayloadObjectSchema, rejecting null clears before they reach the Gateway service layer. Switch fallbacks to a parameter so the patch context can pass the nullable variant, matching the existing pattern for model and toolsAllow. Fixes openclaw#100707 Co-Authored-By: Claude <[email protected]> * test(cron): cover model+fallbacks null clear in patch schema test --------- Co-authored-by: Claude <[email protected]>
…0707) (openclaw#100801) * fix(cron): accept null fallbacks in cron update patch payload createCronPatchObjectSchema passes nullableStringArraySchema for model and toolsAllow, but fallbacks was still hardcoded as a non-nullable array in cronPayloadObjectSchema, rejecting null clears before they reach the Gateway service layer. Switch fallbacks to a parameter so the patch context can pass the nullable variant, matching the existing pattern for model and toolsAllow. Fixes openclaw#100707 Co-Authored-By: Claude <[email protected]> * test(cron): cover model+fallbacks null clear in patch schema test --------- Co-authored-by: Claude <[email protected]>
What Problem This Solves
cron update --patch '{"payload":{"fallbacks":null}}'fails withValidation failed: patch.payload.fallbacks: must be array, blocking users from clearing per-job fallback overrides to restore global agent defaults.cronPayloadObjectSchemahardcodesfallbacksasType.Optional(Type.Array(Type.String()))— non-nullable — whilemodelandtoolsAlloware parameterized so the patch context can pass nullable variantsfallbacksas a parameter tocronPayloadObjectSchema, matching the existing pattern formodelandtoolsAllowsrc/agents/tools/cron-tool.ts(schema parameter + both callers),src/agents/tools/cron-tool.schema.test.ts(null fallback test)zod-schema.agent-model.ts), Gateway types (cron/types.ts), service layer (cron/service/jobs.ts) — all already support null clearsChange Type (select all)
Scope (select all)
Linked Issue/PR
Motivation
Users need to clear per-job
fallbacksoverrides so cron jobs inherit the global agent-level default fallbacks. The CLI (--clear-fallbacks) and Gateway service (mergeCronPayload) already support this, but the tool schema rejectsnullbefore it reaches the service layer. This is the last remaining gap after themodelnull-clear fix incfeaf6897f(#93369 follow-up).Evidence
cron update --patchnow acceptspayload.fallbacks: nullfor clear-to-inheritfix/cron-fallback-null-clear-100707Exact steps before and after this patch:
Unit test results:
Schema comparison (before vs after):
patch.payload.fallbacks: nullValue.Check→ falseValue.Check→ truepatch.payload.fallbacks: ["gpt-5"]Value.Check→ trueValue.Check→ truecreate job.payload.fallbacks: nullValue.Check→ falseValue.Check→ false (unchanged)cron update --patchE2E (requires running Gateway with persistent cron state); the schema-level proof covers the reported rejection path because that path is purely a schema validation gateRoot Cause (if applicable)
Commit
cfeaf6897fparameterizedmodelincronPayloadObjectSchemato enable null clears for the patch context, but did not extend the same parameterization tofallbacks. The field remained hardcoded asType.Optional(Type.Array(Type.String())).User-visible / Behavior Changes
Users can now run
cron update --patch '{"payload":{"fallbacks":null}}'to clear per-job fallbacks and revert to global agent defaults.Security Impact (required)
Human Verification (required)
Value.Checkfor create schema (non-nullable), patch schema (nullable), and array acceptancecron updateE2ECompatibility / Migration
Best-fix Verdict
fallbacksis the exact same pattern used formodelandtoolsAllowin the same functionfallbacksdirectly nullable incronPayloadObjectSchema(simpler but would also accept null in create context, which is semantically unnecessary)AI Assistance 🤖
Risks and Mitigations
None — narrow schema change. The patch context was already designed to accept nullable fields;
fallbackswas simply missed. All existing tests pass.