mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
Fixes #73973. A finite one-shot whose dispatch was claimed (claim_dispatch increments repeat.completed BEFORE execution) but whose run died before mark_job_run was left permanently wedged: completed==times, last_run_at null, state 'scheduled'. The run-claim TTL blocked re-dispatch, and once it expired the dispatch-limit guard silently removed the job with no output and no error. Two complementary fixes: - cron/scheduler.py run_one_job: the outer handler now catches BaseException, not just Exception. The inner run_job handler re-raises CancelledError/KeyboardInterrupt/SystemExit after agent teardown, and none of those are Exception subclasses, so the outer 'except Exception' missed them and mark_job_run(False) was never called. Failures are now recorded first (mark_job_run + finish_execution, each independently guarded), then non-Exception BaseExceptions are re-raised to preserve teardown semantics. Plain Exceptions keep the existing behavior (recorded, return False, no re-raise). Empty str(e) (bare CancelledError) falls back to the exception class name. - cron/jobs.py: when either removal site (claim_dispatch or the get_due_jobs dispatch-limit guard) drops a one-shot whose claimed run never completed (last_run_at null), _write_wedged_oneshot_diagnostic now writes an operator-visible .md into cron/output/<job_id>/ instead of vanishing silently. Best-effort: diagnostics can never break the removal. No diagnostic when last_run_at is set (normal completion race). |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| conftest.py | ||
| test_blueprint_catalog.py | ||
| test_claim_job_for_fire.py | ||
| test_codex_execution_paths.py | ||
| test_compute_next_run_last_run_at.py | ||
| test_cron_context_from.py | ||
| test_cron_direct_api_call_62151.py | ||
| test_cron_inactivity_timeout.py | ||
| test_cron_no_agent.py | ||
| test_cron_profile_isolation.py | ||
| test_cron_prompt_injection_skill.py | ||
| test_cron_provider_pin.py | ||
| test_cron_script.py | ||
| test_cron_workdir.py | ||
| test_cronjob_schema.py | ||
| test_execution_ledger.py | ||
| test_file_permissions.py | ||
| test_jobs.py | ||
| test_jobs_changed_notify.py | ||
| test_jobs_crossprocess_lock.py | ||
| test_jobs_file_ownership.py | ||
| test_parallel_pool.py | ||
| test_reasoning_config_per_model.py | ||
| test_rewrite_skill_refs.py | ||
| test_run_one_job.py | ||
| test_scheduler.py | ||
| test_scheduler_mcp_init.py | ||
| test_scheduler_provider.py | ||
| test_scheduler_shutdown_guard.py | ||
| test_script_claim_heartbeat.py | ||
| test_sessiondb_init_hang.py | ||
| test_shutdown_interrupt.py | ||
| test_suggestions.py | ||
| test_terminal_cwd_lock.py | ||
| test_ticker_stall_60703.py | ||