fix(cron): allow null fallbacks in cron tool patch payload schema#100821
fix(cron): allow null fallbacks in cron tool patch payload schema#100821chenxiaoyu209 wants to merge 1 commit into
Conversation
|
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 detailsBest 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 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. |
|
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 Thank you for the clear report and implementation. Closing this duplicate keeps the canonical history on #100801 / #100707. |
What Problem This Solves
Fixes #100707 — the cron tool's agent-facing TypeBox schema rejected
nullforpatch.payload.fallbacks, preventing users from clearing per-job fallback overrides via the agent tool to restore global inheritance.The underlying Gateway protocol types and
mergeCronPayloadservice layer already support null clears forfallbacks. The gap was only in the tool schema validation layer.Why This Change Was Made
cronPayloadObjectSchemahadfallbackshardcoded asType.Optional(Type.Array(Type.String())), whilemodelandtoolsAllowwere already parameterized and made nullable in the patch schema. This change adds afallbacksparameter to match the existing pattern, passing a non-nullable schema for job creation and a nullablestring[] | nullschema 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 failedpnpm test src/agents/tools/cron-tool.test.ts: 140 passed, 0 failedChanges:
fallbacksincronPayloadObjectSchema, pass nullable variant in patch schemamodel: nullandfallbacks: nullassertions in null-clear tests, add provider projection assertions forfallbacksNote: 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