hermes-agent/tests/cron
briandevans f54935738c fix(cron): surface agent run_conversation failure flags as job failure
run_job() ignored the result's `failed=True` / `completed=False` flags
that agent.run_conversation populates on API exhaustion, mid-run
interrupts, and model aborts. Because final_response on those paths is
often a non-empty error string ("API call failed after 3 retries:
Request timed out."), the existing empty-response soft-fail in
_process_job did not trip either: the error text was delivered as if it
were the agent's reply and last_status was set to "ok" with no error
notification. Detect those flags right after the dict-shape guard and
raise so the existing except handler builds the proper failure tuple,
preserving the agent's error message via result["error"].

Adds a parametrized regression covering: API-retry-exhausted with error
text in final_response, completed=False with no final_response,
completed=False without an explicit failed flag, and the partial-reply
plus failed=True case. Plus a guard that a normal completed=True success
result is still treated as success.

Fixes #17855

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 03:27:37 -07:00
..
__init__.py test: add unit tests for 8 modules (batch 2) 2026-02-26 13:54:20 +03:00
test_codex_execution_paths.py refactor: remove smart_model_routing feature (#12732) 2026-04-19 18:12:55 -07:00
test_compute_next_run_last_run_at.py fix(cron): use last_run_at as croniter base for cron jobs 2026-04-29 08:24:48 -07:00
test_cron_context_from.py fix(cron): wire context_from through the update action 2026-04-25 04:49:28 -07:00
test_cron_inactivity_timeout.py fix(cron): fall back gracefully when HERMES_CRON_TIMEOUT is invalid 2026-04-29 08:21:04 -07:00
test_cron_script.py fix(cron): harden scheduler against path traversal and env leaks 2026-04-06 12:42:16 -07:00
test_cron_workdir.py fix(cron): keep SOUL.md identity when workdir is unset 2026-04-29 08:10:25 -07:00
test_file_permissions.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_jobs.py fix(cron): don't silently disable recurring cron jobs when croniter is missing (#16368) 2026-04-26 21:47:32 -07:00
test_scheduler.py fix(cron): surface agent run_conversation failure flags as job failure 2026-04-30 03:27:37 -07:00