fix(cron): reject unknown fields in update_job instead of silently persisting (#67625) - #76831
Closed
Enough1122 wants to merge 3 commits into
Closed
fix(cron): reject unknown fields in update_job instead of silently persisting (#67625)#76831Enough1122 wants to merge 3 commits into
Enough1122 wants to merge 3 commits into
Conversation
teknium1
reviewed
Aug 2, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for isolating the unchecked storage merge; the premise is confirmed on current main: cron/jobs.py:1534 merges arbitrary update keys after only the immutable-id guard.
Problems
- The whitelist added by
2578882ef5faomitsdescription. The linked #66786 discussion documents thatdescriptioncurrently round-trips via this update path and that its feature work remains open, so this would turn existing behavior into a rejection. - The gateway REST path still silently drops unknown keys in mixed requests at
gateway/platforms/api_server.py:5355; its current behavior is asserted bytests/gateway/test_api_server_jobs.py:189-213. That does not meet a uniform “unknown fields fail loudly” contract.
Suggested changes
- Settle and test the supported update-field contract, including
descriptioncompatibility. - Reject unknown raw REST keys before sanitization if the intended guarantee covers that API surface.
Automated hermes-sweeper review.
…rsisting (NousResearch#67625) update_job merged update payloads unconditionally (only 'id' was guarded), so a typo like 'promt' was persisted to jobs.json and reported as a successful update while the real prompt stayed unchanged. Add an _UPDATEABLE_JOB_FIELDS whitelist (create_job parameters + schedule_display + the lifecycle fields pause/resume/trigger persist) and raise ValueError listing the unknown keys. Dashboard/API paths already translate ValueError to HTTP 400, so typo'd payloads now fail loudly.
Enough1122
force-pushed
the
fix/67625-update-job-validation
branch
from
August 2, 2026 15:21
2578882 to
6e18739
Compare
This was referenced Aug 3, 2026
…sResearch#76831) description round-trips through update_job and is the compatibility basis for the open NousResearch#66786 description feature. Without this entry, update_job silently drops the field rather than accepting or loudly rejecting it.
Contributor
Author
|
Closing as duplicate: #67660 (Ahmett101, opened 2 weeks earlier) fixes the same issue #67625 with the same whitelist strategy in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
update_jobincron/jobs.pymerged update payloads unconditionally — the only guard was_IMMUTABLE_JOB_FIELDS = {"id"}. Any unknown key, including typos likepromtinstead ofprompt, was silently persisted tojobs.jsonand reported as success via the API while the real field stayed unchanged — the illusion of a successful update.Fix: add an
_UPDATEABLE_JOB_FIELDSwhitelist (thecreate_job()parameter set +schedule_display+ the lifecycle fieldsenabled/state/paused_at/paused_reason/next_run_atthatpause_job/resume_job/trigger_jobpersist throughupdate_job). Unknown keys now raiseValueErrorlisting the offending fields. The dashboard API handler already translatesValueError→ HTTP 400, so typo'd payloads fail loudly on every surface (dashboard, CLI, cronjob tool).Single-file change (+ 2 regression tests). No public API change.
NOT doing X: not rejecting fields that internal scheduler paths legitimately write (pause/resume/trigger keep working — covered by the existing lifecycle tests), not adding 422-vs-400 semantics — the existing ValueError→400 conversion is reused as-is.
Test plan