Skip to content

fix(cron): allow null fallbacks in cron tool patch payload schema#100821

Closed
chenxiaoyu209 wants to merge 1 commit into
openclaw:mainfrom
chenxiaoyu209:fix/cron-tool-fallbacks-nullable
Closed

fix(cron): allow null fallbacks in cron tool patch payload schema#100821
chenxiaoyu209 wants to merge 1 commit into
openclaw:mainfrom
chenxiaoyu209:fix/cron-tool-fallbacks-nullable

Conversation

@chenxiaoyu209

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes #100707 — the cron tool's agent-facing TypeBox schema rejected null for patch.payload.fallbacks, preventing users from clearing per-job fallback overrides via the agent tool to restore global inheritance.

The underlying Gateway protocol types and mergeCronPayload service layer already support null clears for fallbacks. The gap was only in the tool schema validation layer.

Why This Change Was Made

cronPayloadObjectSchema had fallbacks hardcoded as Type.Optional(Type.Array(Type.String())), while model and toolsAllow were already parameterized and made nullable in the patch schema. This change adds a fallbacks parameter to match the existing pattern, passing a non-nullable schema for job creation and a nullable string[] | null schema for patch/update operations.

User Impact

Users can now clear per-job fallback overrides via the cron agent tool with patch.payload.fallbacks: null, restoring global agent defaults without deleting and recreating the cron job.

Evidence

  • pnpm test src/agents/tools/cron-tool.schema.test.ts: 17 passed, 0 failed
  • pnpm test src/agents/tools/cron-tool.test.ts: 140 passed, 0 failed

Changes:

Note: An existing PR (#100720) addresses the related zod config schema layer (src/config/zod-schema.agent-model.ts). This PR fixes the TypeBox agent tool schema layer, which is where the actual user-facing validation rejection occurs.

🤖 Generated with Claude Code

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Jul 6, 2026
@clawsweeper

clawsweeper Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Close as superseded: this PR makes the same central cron TypeBox schema change as the earlier proof-positive #100801, while this branch still lacks real behavior proof and generated prompt snapshot updates.

Canonical path: Use #100801 as the landing path for the cron tool schema fix, then close the linked issue when that proof-positive PR lands with green required checks.

So I’m closing this here and keeping the remaining discussion on #100801.

Review details

Best possible solution:

Use #100801 as the landing path for the cron tool schema fix, then close the linked issue when that proof-positive PR lands with green required checks.

Do we have a high-confidence way to reproduce the issue?

Yes by source inspection. Current main keeps patch.payload.fallbacks non-null in createCronToolSchema(), while the gateway schema and service merge path already accept and clear null fallbacks.

Is this the best way to solve the issue?

No for this branch as the landing path. The runtime code shape is plausible, but #100801 already owns the same fix with stronger proof, while this branch lacks real behavior proof and prompt snapshot updates.

Security review:

Security review cleared: The diff only changes TypeBox schema wiring and focused tests; it adds no dependencies, scripts, permissions, secret handling, or supply-chain surface.

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

Codex review notes: model internal, reasoning high; reviewed against 41bea62b4a28.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 6, 2026
@steipete steipete self-assigned this Jul 6, 2026
@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Superseded by #100801, landed as a98a646.

The landed fix owns the same cron TypeBox patch-schema boundary, includes the generated Codex prompt snapshots, and adds runtime schema coverage proving payload.model: null and payload.fallbacks: null are accepted. I also verified current main carries the service-side delete-on-null behavior, so no unique fix remains on this branch.

Thank you for the clear report and implementation. Closing this duplicate keeps the canonical history on #100801 / #100707.

@steipete steipete closed this Jul 6, 2026
@chenxiaoyu209
chenxiaoyu209 deleted the fix/cron-tool-fallbacks-nullable branch July 8, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: cron tool schema rejects null for payload.model/fallbacks, blocking clear-to-inherit

2 participants