Skip to content

fix(cron): allow null model and fallbacks in cron update patch payload#100720

Closed
sunlit-deng wants to merge 3 commits into
openclaw:mainfrom
sunlit-deng:sunlit/fix/cron-fallbacks-nullable
Closed

fix(cron): allow null model and fallbacks in cron update patch payload#100720
sunlit-deng wants to merge 3 commits into
openclaw:mainfrom
sunlit-deng:sunlit/fix/cron-fallbacks-nullable

Conversation

@sunlit-deng

@sunlit-deng sunlit-deng commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users would see must be array when clearing cron per-job overrides with cron update --patch '{"payload":{"fallbacks":null}}'.

Fixes #100707

Why This Change Was Made

AgentModelSchema and AgentToolModelSchema used z.array(z.string()).optional() — optional but not nullable. Adding .nullable() lets null clears reach the Gateway service layer, which already deletes stored override keys on null input.

User Impact

Users can clear per-job fallback overrides via cron update --patch with null values to restore global agent defaults.

Evidence

  • pnpm test -- --run -t "nullable fallback" src/config/zod-schema.models.test.ts: 6 passed, 0 failed, Duration 1.11s
[test] starting test/vitest/vitest.runtime-config.config.ts

 RUN  v4.1.9 …/openclaw

 Test Files  1 passed (1)
      Tests  6 passed | 18 skipped (24)
   Start at  15:42:06
   Duration  1.11s

Focused tests cover null acceptance (both schemas), array acceptance, and negative control (non-array non-null rejected).

AI-assisted: built with Codex

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord size: XS triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 6, 2026
@sunlit-deng
sunlit-deng force-pushed the sunlit/fix/cron-fallbacks-nullable branch from b2c2ca1 to e06976c Compare July 6, 2026 07:29
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed channel: discord Channel integration: discord size: XS labels Jul 6, 2026
@sunlit-deng
sunlit-deng force-pushed the sunlit/fix/cron-fallbacks-nullable branch from e06976c to d12b6fa Compare July 6, 2026 07:51
@sunlit-deng
sunlit-deng requested a review from a team as a code owner July 6, 2026 07:51
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord channel: telegram Channel integration: telegram app: android App: android app: ios App: ios app: macos App: macos app: web-ui App: web-ui gateway Gateway runtime extensions: memory-core Extension: memory-core cli CLI command changes scripts Repository scripts commands Command implementations docker Docker and sandbox tooling agents Agent runtime and tooling channel: feishu Channel integration: feishu extensions: openai extensions: qa-lab size: XL and removed size: S labels Jul 6, 2026
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Jul 6, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed cli CLI command changes scripts Repository scripts commands Command implementations docker Docker and sandbox tooling agents Agent runtime and tooling channel: feishu Channel integration: feishu extensions: openai extensions: qa-lab size: XL labels Jul 6, 2026
@github-actions github-actions Bot removed the dependencies-changed PR changes dependency-related files label Jul 6, 2026
@clawsweeper

clawsweeper Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I did a careful shell check against current main, and this is already implemented.

Current main already fixes the reported cron update null-clear path through the merged cron tool-schema change, while this branch targets broader config schemas and should not remain a landing candidate.

So I’m closing this as already implemented rather than keeping a duplicate issue open.

Review details

Best possible solution:

Keep the narrow current-main cron tool-schema fix from #100801 and treat any nullable config fallback contract as a separate maintainer-approved proposal.

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

Yes for the original shipped bug by source and issue evidence, but no current-main failure remains: createCronToolSchema() now accepts payload.model: null and payload.fallbacks: null in update patches.

Is this the best way to solve the issue?

No. This branch changes broader Zod config schemas, while the best and already-merged fix is the narrow cron tool TypeBox patch payload schema change.

Security review:

Security review cleared: The diff only changes local Zod schemas and tests; it adds no dependencies, code execution paths, permissions, secrets handling, or supply-chain surface.

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • SunnyShu0925: Authored the merged canonical PR that parameterized cron tool fallbacks and added the runtime schema regression test now on main. (role: current-main fix author; confidence: high; commits: c2d0962a470b, ed311c9df535, a98a64649ec0; files: src/agents/tools/cron-tool.ts, src/agents/tools/cron-tool.schema.test.ts)
  • brunolorente: PR fix(cron-tool): add typed properties to job/patch schemas #55043 introduced the typed cron job/patch schema properties and adjacent schema tests that define this validation layer. (role: introduced typed cron tool schema surface; confidence: high; commits: ca76e2fedc8e; files: src/agents/tools/cron-tool.ts, src/agents/tools/cron-tool.schema.test.ts, src/agents/tools/cron-tool.test.ts)
  • 849261680: PR fix(cron): expose per-job fallbacks in CLI #93369 added the shipped per-job fallback CLI clear behavior and service/protocol support that the cron tool schema must expose. (role: recent cron fallback contributor; confidence: high; commits: 1662b07810eb; files: src/cli/cron-cli/register.cron-edit.ts, src/cron/service/jobs.ts, src/cron/types.ts)

Codex review notes: model internal, reasoning high; reviewed against a98a64649ec0; fix evidence: commit a98a64649ec0, main fix timestamp 2026-07-06T06:48:00-07:00.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 6, 2026
@sunlit-deng
sunlit-deng force-pushed the sunlit/fix/cron-fallbacks-nullable branch from 12139de to 271fb26 Compare July 6, 2026 08:58
@sunlit-deng

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

AgentModelSchema and AgentToolModelSchema used
z.array(z.string()).optional() which accepts undefined
but not null. Adding .nullable() lets null clears reach
the Gateway service layer, which already deletes stored
override keys on null input.

Fixes openclaw#100707
@sunlit-deng

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper

clawsweeper Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

@clawsweeper clawsweeper Bot closed this Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S 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

1 participant