Repository navigation
fix(cron): trim trailing whitespace from recognized job object keys - #95674
openclaw-clownfish[bot] merged 2 commits into
Conversation
…penclaw#95407) Some tool-call extraction/serialization pipelines can produce cron object keys with trailing spaces (e.g. 'schedule ' instead of 'schedule'), causing gateway validation to reject the job. Add repairPaddedCronKeys() to canonicalizeCronToolObject() that trims only recognized CRON_RECOVERABLE_OBJECT_KEYS. Non-recognized keys (including special ones like '__proto__') are never trimmed, preventing prototype pollution. When both padded and canonical forms exist, the canonical key wins. Tests: - add job with trailing-space keys -> trimmed - update patch with trailing-space keys -> trimmed - non-recognized padded keys left intact (safety) - canonical key preserved over padded duplicate - clean keys unchanged 133 tests pass (128 existing + 5 new).
|
Codex review: needs maintainer review before merge. Reviewed June 22, 2026, 2:28 PM ET / 18:28 UTC. Summary PR surface: Source +28, Tests +136. Total +164 across 2 files. Reproducibility: yes. source-level: current main passes whitespace-padded cron job/patch keys through the cron canonicalizer, and the strict gateway cron schemas reject unexpected properties. I did not run the live qwen35b/llama.cpp route in this read-only review. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land one narrow allowlisted cron canonicalization fix, then close the duplicate candidate PRs once the canonical fix merges. Do we have a high-confidence way to reproduce the issue? Yes, source-level: current main passes whitespace-padded cron job/patch keys through the cron canonicalizer, and the strict gateway cron schemas reject unexpected properties. I did not run the live qwen35b/llama.cpp route in this read-only review. Is this the best way to solve the issue? Yes, the cron canonicalizer is the best boundary for this reported nested job/patch repair because earlier model-friendly cron argument recovery already lives there and gateway validation remains strict. The remaining maintainer decision is which sibling PR should be the canonical landing path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 03ba09bfa867. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +28, Tests +136. Total +164 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
… exists (openclaw#95407) When both a padded key (e.g. 'schedule ') and its canonical form ('schedule') exist, the padded key is now preserved so strict gateway validation rejects the ambiguous input rather than silently picking one value. Only padded keys without a canonical counterpart are trimmed.
|
Addressed both ClawSweeper findings:
|
…penclaw#95674) * fix(cron): trim trailing whitespace from recognized job object keys (openclaw#95407) Some tool-call extraction/serialization pipelines can produce cron object keys with trailing spaces (e.g. 'schedule ' instead of 'schedule'), causing gateway validation to reject the job. Add repairPaddedCronKeys() to canonicalizeCronToolObject() that trims only recognized CRON_RECOVERABLE_OBJECT_KEYS. Non-recognized keys (including special ones like '__proto__') are never trimmed, preventing prototype pollution. When both padded and canonical forms exist, the canonical key wins. Tests: - add job with trailing-space keys -> trimmed - update patch with trailing-space keys -> trimmed - non-recognized padded keys left intact (safety) - canonical key preserved over padded duplicate - clean keys unchanged 133 tests pass (128 existing + 5 new). * fix(cron): preserve padded duplicate keys when canonical form already exists (openclaw#95407) When both a padded key (e.g. 'schedule ') and its canonical form ('schedule') exist, the padded key is now preserved so strict gateway validation rejects the ambiguous input rather than silently picking one value. Only padded keys without a canonical counterpart are trimmed.
Fixes #95407
What Problem This Solves
Some tool-call extraction/serialization pipelines produce cron object keys with trailing spaces (e.g. "schedule " instead of "schedule"), causing gateway validation to reject the job with "unexpected property" errors.
Only specific top-level keys are affected (schedule, sessionTarget, payload, enabled). Nested keys and keys like name/description are not affected.
Evidence
Fix
Added
repairPaddedCronKeys()tocanonicalizeCronToolObject()that trims whitespace from recognized cron object keys before any schema processing.Safety design:
CRON_RECOVERABLE_OBJECT_KEYSare trimmed — arbitrary keys (including__proto__,constructor) are never mutated"schedule"and"schedule "), the padded key is preserved so strict gateway validation rejects the ambiguous input rather than silently picking one valueReal behavior proof
__proto__) are never mutated; normal keys are unchangedTests (5 new, 133 total)
Checks
oxfmt✓oxlint✓origin/main