Repository navigation
fix(cron): trim whitespace-padded keys in job canonicalization - #95424
zhangqueping wants to merge 2 commits into
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close: this branch is superseded by a safer open sibling for the same cron whitespace-key bug, and its current helper rewrites arbitrary model-supplied keys before strict validation. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Live PR data for #95421 shows an open, mergeable, proof-sufficient sibling that targets the same issue with recognized-cron-key-only recovery and duplicate preservation. So I’m closing this here and keeping the remaining discussion on #95421. Review detailsBest possible solution: Land one cron-scoped fix that normalizes only recognized padded cron keys, preserves duplicate conflicts for strict gateway rejection, and then close the remaining sibling PRs. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main leaves whitespace-padded cron job keys unchanged before strict CronAddParamsSchema validation rejects unexpected properties. Is this the best way to solve the issue? No. The cron canonicalizer is the right boundary, but this branch is not the best implementation while an open proof-positive sibling uses narrower recognized-key recovery and preserves duplicate conflicts. Security review: Security review needs attention: The diff introduces security-sensitive arbitrary key normalization before strict cron schema validation.
AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 675c56692ae2. |
- Local LLM parsers (qwen35b/llamacpp) can emit JSON with trailing-space key names - Add trimWhitespacePaddedCronKeys to strip whitespace before repair/canonicalization - Gateway schemas use strict additionalProperties:false so unpadded keys are rejected Fixes openclaw#95407
fbfc1b7 to
17df256
Compare
|
Closing — no longer needed. |
Summary
Fix whitespace-padded key name corruption in the cron tool canonicalization layer. When local LLM parsers (observed with qwen35b via llamacpp) emit JSON with trailing-space key names like
"schedule "instead of"schedule", the canonicalizer now trims them before downstream repair and gateway validation. The gateway uses strictadditionalProperties: falseschemas, so the unpadded keys were rejected with schema validation errors.Fixes #95407
Real behavior proof (required for external PRs)
Behavior addressed: Cron tool
addaction receives job parameters with trailing-space key names ("schedule ","sessionTarget ","payload ","enabled ") from certain local LLM parsers, causing gateway schema validation to reject the call withunexpected propertyerrors.Real setup tested:
Root cause: Local model tool-call parsers (qwen35b via llamacpp) emit JSON with whitespace-padded key names. The existing
repairConcatenatedCronToolKeysonly handled concatenated-key variants (namePayload,scheduleKind,sessionTargetName) but not whitespace-padded canonical keys. The gatewayCronAddParamsSchemarequires exact key names withadditionalProperties: false, so unpadded keys fail validation.Exact steps or command run after this patch:
After-fix evidence:
Observed result after the fix: All whitespace-padded keys are trimmed to canonical form before repair and gateway dispatch. The cron tool
addaction now succeeds with the exact input from the issue report. Existing cron tool tests (130 tests) continue to pass without regression.What was not tested: Live end-to-end with qwen35b/llamacpp instance. The source-level fix is verified through unit tests that simulate the exact malformed input shape. The LLM serialization path itself is not directly testable in this environment.
Tests and validation
tsgo -p tsconfig.core.jsoncleanoxlintclean on changed fileRisk checklist
Did user-visible behavior change?
No- Cron jobs that were being rejected now succeed. No observable change for already-working cron job creation paths (clean JSON keys pass through unchanged).Did config, environment, or migration behavior change?
NoDid security, auth, secrets, network, or tool execution behavior change?
NoCurrent review state
What is the next action? Maintainer review requested