fix(cron): treat empty agent response as error in last_status (fixes #8585)#8634
Closed
iacker wants to merge 1 commit into
Closed
fix(cron): treat empty agent response as error in last_status (fixes #8585)#8634iacker wants to merge 1 commit into
iacker wants to merge 1 commit into
Conversation
…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.
Contributor
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
final_responsefrom agent as a soft failure intick()solast_statusis"error"instead of"ok"test_tick_marks_empty_response_as_errorRoot cause
scheduler.py:tick()passedsuccess=Truetomark_job_runregardless of whetherfinal_responsewas empty. Themark_job_runfunction then setlast_status = "ok"unconditionally.Fix
In
tick(), afterrun_job()returns, check iffinal_responseis empty. If so, overridesuccess=Falsewith a descriptive error message before callingmark_job_run.Testing
tests/cron/test_scheduler.py::TestRunJobSessionPersistence::test_tick_marks_empty_response_as_errorpytest tests/cron/test_scheduler.py -q→ 62 passedFixes #8585