fix(cli): read terminal state from the normalised job in console cron run
Some checks failed
Deploy Site / deploy-vercel (push) Has been cancelled
Deploy Site / deploy-docs (push) Has been cancelled
auto-fix lint issues & formatting / Generate eslint --fix patch (push) Has been cancelled
auto-fix lint issues & formatting / Apply patch (push) Has been cancelled
Skills Index Freshness Check / check-freshness (push) Has been cancelled
Skills Index Freshness Check / check-catalog-cors (push) Has been cancelled
Docs Search Monitor / probe (push) Has been cancelled
Build Skills Index / build-index (push) Has been cancelled
Build Skills Index / trigger-deploy (push) Has been cancelled
Catalog core imports index / refresh (push) Has been cancelled
Canary Release / Tag, draft, and start the canary build (push) Has been cancelled
Canary Release / Prune canaries older than 14 days (push) Has been cancelled

A malformed stored state (e.g. a list) made is_terminal_job raise
TypeError on the raw record; the normalised view coerces it.
This commit is contained in:
Teknium
2026-11-24 01:15:51 -08:00
parent c1ff06b8e1
commit b7ee21c14e

View File

@@ -812,7 +812,7 @@ def _cron_run(_engine: HermesConsoleEngine, args: list[str]) -> str:
with _jobs_lock():
job = resolve_job_ref(ref)
stored = job and next((j for j in load_jobs() if j.get("id") == job["id"]), job)
if stored and not is_terminal_job(stored) and not is_job_runnable(stored):
if stored and not is_terminal_job(job) and not is_job_runnable(stored):
raise ConsoleCommandError(NOT_RUNNABLE_ERROR)
return trigger_job(ref)