Skip to content

fix(cron): treat empty agent response as error in last_status (fixes #8585)#8634

Closed
iacker wants to merge 1 commit into
NousResearch:mainfrom
iacker:fix/issue-8585-cron-empty-response
Closed

fix(cron): treat empty agent response as error in last_status (fixes #8585)#8634
iacker wants to merge 1 commit into
NousResearch:mainfrom
iacker:fix/issue-8585-cron-empty-response

Conversation

@iacker

@iacker iacker commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Treats empty final_response from agent as a soft failure in tick() so last_status is "error" instead of "ok"
  • When a cron job's agent run completes but produces no output (e.g. API 404 from invalid model name), the failure is now visible in job listings
  • Adds regression test test_tick_marks_empty_response_as_error

Root cause

scheduler.py:tick() passed success=True to mark_job_run regardless of whether final_response was empty. The mark_job_run function then set last_status = "ok" unconditionally.

Fix

In tick(), after run_job() returns, check if final_response is empty. If so, override success=False with a descriptive error message before calling mark_job_run.

Testing

  • New test: tests/cron/test_scheduler.py::TestRunJobSessionPersistence::test_tick_marks_empty_response_as_error
  • Full suite: pytest tests/cron/test_scheduler.py -q → 62 passed

Fixes #8585

…ousResearch#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

Copy link
Copy Markdown
Contributor

Merged via PR #11044 (#11044). Your commit was cherry-picked onto current main with your authorship preserved in git log. Clean fix — thanks @iacker!

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