fix(cron): allow null to clear model/fallbacks/thinking overrides on patch#67429
fix(cron): allow null to clear model/fallbacks/thinking overrides on patch#67429fangweili wants to merge 1 commit into
Conversation
Greptile SummaryAdds null-as-clear semantics for Confidence Score: 5/5Safe to merge — additive schema change, correct null-coercion, and no regressions against the existing patch contract. All changes follow the already-established toolsAllow pattern. The null ?? undefined coercion in buildPayloadFromPatch is correct, delete next.model branches in mergeCronPayload are symmetric with the existing toolsAllow delete branch, and the TypeBox schema evolution is purely additive. No P0 or P1 findings. No files require special attention. Reviews (1): Last reviewed commit: "fix(cron): allow null to clear model/fal..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ed477347a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| modelNullable: true, | ||
| fallbacksNullable: true, | ||
| thinkingNullable: true, |
There was a problem hiding this comment.
Preserve null override fields during cron.update normalization
Allowing null in CronPayloadPatchSchema here does not actually enable clearing overrides for gateway callers, because cron.update normalizes params.patch before validation and update (normalizeCronJobPatch in src/gateway/server-methods/cron.ts), and coercePayload currently deletes payload.model, payload.thinking, and payload.fallbacks when they are null (it only preserves strings/arrays, unlike toolsAllow which uses allowNull). In practice, requests like payload: { kind: "agentTurn", model: null } are still normalized into a no-op, so the new patch semantics are unreachable through the main API path.
Useful? React with 👍 / 👎.
9ed4773 to
d3bd5c0
Compare
|
Good catch, @chatgpt-codex-connector! Fixed in the latest commit.
Fix:
Added 3 new tests in |
|
To use Codex here, create an environment for this repo. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d3bd5c06cf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if ("model" in next) { | ||
| const model = parseOptionalField(TrimmedNonEmptyStringFieldSchema, next.model); | ||
| if (model !== undefined) { | ||
| next.model = model; | ||
| if (next.model === null) { | ||
| next.model = null; | ||
| } else { |
There was a problem hiding this comment.
Keep null-clearing semantics scoped to cron.update patches
coercePayload runs for both normalizeCronJobPatch and normalizeCronJobCreate, so preserving model: null here (and the analogous thinking/fallbacks branches below) changes cron.add behavior too: create requests that include nullable placeholders now reach schema validation with null still present and are rejected because CronPayloadSchema only accepts string/array values for those fields. Before this change, those nulls were dropped during normalization, so existing callers that serialize optional fields as null will regress from successful creates to INVALID_REQUEST failures.
Useful? React with 👍 / 👎.
…patch Passing null for payload.model, payload.fallbacks, or payload.thinking in a cron.update call previously silently no-oped — the field could not be cleared once set. The only workaround was manually editing jobs.json with the gateway stopped. Fix: treat null explicitly as 'delete this key' in mergeCronPayload, mirroring the existing pattern already used for toolsAllow. Changes: - src/cron/types.ts: add string|null to model/fallbacks/thinking in CronAgentTurnPayloadPatch (with JSDoc explaining null semantics) - src/cron/service/jobs.ts: add null-clear branches in mergeCronPayload; coerce null to undefined in buildPayloadFromPatch - src/gateway/protocol/schema/cron.ts: allow null in CronPayloadPatchSchema for model/fallbacks/thinking (patch only, not create) - src/cron/service/jobs.apply-patch.test.ts: add 5 tests covering set, null-clear, and absent (no-op) for all three fields All 620 cron tests pass.
d3bd5c0 to
a00d688
Compare
|
Follow-up to the previous fix: added 3 end-to-end tests in |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a00d688c97
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (next.model === null) { | ||
| next.model = null; | ||
| } else { |
There was a problem hiding this comment.
Keep null-clearing logic out of cron.add normalization
coercePayload is used by both normalizeCronJobPatch and normalizeCronJobCreate, so preserving model: null here also changes create normalization. In the cron.add path (src/gateway/server-methods/cron.ts), the normalized object is validated against CronPayloadSchema, which still requires string/array values, so create requests that previously worked when clients serialized optional overrides as null now return INVALID_REQUEST; the same regression is introduced for thinking and fallbacks in the adjacent branches. Fresh evidence: this commit changed create-time coercion at this site while CronPayloadSchema remains non-nullable for those fields.
Useful? React with 👍 / 👎.
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Keep this PR open because the fallbacks/thinking null-clear behavior remains useful, but the submitted branch is not merge-ready: it is conflicting against current main, lacks real behavior proof, and moves null preservation into shared create/update normalization in a way that can break existing Canonical path: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review. So I’m closing this here because the remaining work is already tracked in the canonical issue. Review detailsBest possible solution: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review. Do we have a high-confidence way to reproduce the issue? Yes, from source inspection: current main drops Is this the best way to solve the issue? No, not as submitted. The narrow fix should preserve null only for update patches, not in the shared create/update normalizer, and should be rebased onto the current Security review: Security review cleared: No concrete security or supply-chain concern found; the diff is limited to cron/gateway protocol, service/types, and tests. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 4644e0c10256. |
|
Codex review: needs changes before merge. What this changes: The PR adds null-as-clear semantics for cron.update payload.model, payload.fallbacks, and payload.thinking across cron patch types, gateway schema, normalization, service merge logic, and regression tests. Required change before merge: This is a concrete, narrow PR-branch repair: scope null preservation to cron.update patches while preserving cron.add create behavior, with clear files and validation commands. Review detailsBest possible solution: Land a revised version that defines null-clear as a cron.update patch-only contract, preserves create-time optional-null tolerance, deletes the three stored payload overrides when patch values are null, and covers the normalize-to-apply path plus create compatibility in regression tests. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against acae48b790fa. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper applied the proposed close for this PR.
|
Problem
Passing
nullforpayload.model,payload.fallbacks, orpayload.thinkingin acron.updatecall silently no-ops — the field cannot be cleared once set. The only workaround is manually editing~/.openclaw/cron/jobs.jsonwith the gateway stopped.Fix
Treat
nullexplicitly as "delete this key" inmergeCronPayload, mirroring the existing pattern already used fortoolsAllow.Changes
src/cron/types.ts: addstring | nulltomodel/fallbacks/thinkinginCronAgentTurnPayloadPatchwith JSDoc explaining null semanticssrc/cron/service/jobs.ts: add null-clear branches inmergeCronPayload; coercenull → undefinedinbuildPayloadFromPatchsrc/gateway/protocol/schema/cron.ts: allownullinCronPayloadPatchSchemaformodel/fallbacks/thinking(patch only, not create)src/cron/service/jobs.apply-patch.test.ts: 5 new tests covering set, null-clear, and absent (no-op) for all three fieldsTesting
pnpm vitest run src/cron/)pnpm check)