mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
update_job() assumed the schedule value was always a pre-parsed dict and called .get() on it directly. When the API passes a raw string like "every 10m", this crashed with AttributeError. The create path already handles this correctly by calling parse_schedule() on the incoming string. The fix adds the same normalization to the update path: if the schedule is a string, parse it into a dict before proceeding. Closes #10129
This commit is contained in:
parent
305a702e09
commit
c4674cbe21
1 changed files with 6 additions and 0 deletions
|
|
@ -501,6 +501,12 @@ def update_job(job_id: str, updates: Dict[str, Any]) -> Optional[Dict[str, Any]]
|
|||
|
||||
if schedule_changed:
|
||||
updated_schedule = updated["schedule"]
|
||||
# The API may pass schedule as a raw string (e.g. "every 10m")
|
||||
# instead of a pre-parsed dict. Normalize it the same way
|
||||
# create_job() does so downstream code can call .get() safely.
|
||||
if isinstance(updated_schedule, str):
|
||||
updated_schedule = parse_schedule(updated_schedule)
|
||||
updated["schedule"] = updated_schedule
|
||||
updated["schedule_display"] = updates.get(
|
||||
"schedule_display",
|
||||
updated_schedule.get("display", updated.get("schedule_display")),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue