Skip to content

fix(cron): treat empty agent response as error in last_status#11044

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-4013432a
Apr 16, 2026
Merged

fix(cron): treat empty agent response as error in last_status#11044
teknium1 merged 2 commits into
mainfrom
hermes/hermes-4013432a

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Salvage of PR #8634 by @iacker.

The bug: When a cron job completes but the agent produces no output (e.g. silent API 404 from invalid model name), run_job() returns success=True with empty final_response. tick() then calls mark_job_run(success=True), so last_status is stored as "ok" — the failure is completely invisible in /cron list. Users can go days without realizing their jobs are silently producing nothing.

The fix: In tick(), after run_job() returns, check if success=True but final_response is empty. If so, flip success=False with a descriptive error message before calling mark_job_run(). Uses existing error status — no new states, no API changes.

Live test results (4 scenarios against real tick/jobs pipeline):

Scenario last_status Result
success + empty response "error" + diagnostic message ✓ Fixed
success + real content "ok" ✓ No regression
success=False + real error "error" + original message ✓ No regression
mark_job_run arg interception receives success=False ✓ Fix fires correctly

Follow-up

  • Added iacker to AUTHOR_MAP

Files changed

  • cron/scheduler.py — 7-line check in tick() (+7/-0)
  • tests/cron/test_scheduler.py — regression test (+39/-2)
  • scripts/release.py — AUTHOR_MAP entry (+1/-0)

Test results

  • tests/cron/: 171 passed, 4 skipped
  • E2E: 4 scenarios against real job files on disk

Closes #8634. Fixes #8585.

iacker and others added 2 commits April 16, 2026 06:43
…8585)

When a cron job's agent run completes but produces an empty final_response
(e.g. API 404 from invalid model name), the scheduler now marks last_status
as "error" instead of "ok", so the failure is visible in job listings.

Previously, any run that didn't raise an exception was marked "ok" regardless
of whether the agent actually produced output.
@teknium1 teknium1 merged commit f938fe4 into main Apr 16, 2026
4 of 5 checks passed
@teknium1 teknium1 deleted the hermes/hermes-4013432a branch April 16, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Cron scheduler reports last_status "ok" when agent produces empty response

2 participants