fix(cron): treat empty agent response as error in last_status#11044
Merged
Conversation
…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.
This was referenced Apr 16, 2026
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
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()returnssuccess=Truewith emptyfinal_response.tick()then callsmark_job_run(success=True), solast_statusis 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(), afterrun_job()returns, check ifsuccess=Truebutfinal_responseis empty. If so, flipsuccess=Falsewith a descriptive error message before callingmark_job_run(). Uses existing error status — no new states, no API changes.Live test results (4 scenarios against real tick/jobs pipeline):
"error"+ diagnostic message"ok""error"+ original messagesuccess=FalseFollow-up
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 skippedCloses #8634. Fixes #8585.