feat: wire cron failure digest into CLI user turn (Closes #433)#476
Merged
Conversation
added 2 commits
June 23, 2026 06:09
- Persist per-job run status under ~/.hermes/cron/failures/ via save_job_failure/list_job_failures/get_latest_failure. - run_one_job writes a failure record (last output + traceback) on every failed run and a success marker on recovery, replacing invisible cron failures with a durable audit trail. - Add opt-in cron.failure_digest config key; build_cron_failure_digest() surfaces recent un-acked failures to the user on the next interaction. - Recognize circuit_breaker as a known custom-provider config key. - Add tests covering persistence, latest resolution, run_one_job hooks, digest gating, and ack behavior. Closes #433 Co-Authored-By: Hermes Evolution <evolution@hermes.ai>
The persistence and build_cron_failure_digest helper from the first slice were not connected to any user-interaction path, so the digest never reached the operator. This change: - Adds a small lazy-import helper _get_cron_failure_digest_for_user(). - Surfaces the digest at the start of HermesCLI.chat() before the user message is sent to the agent. - Prepends the same digest to the model's user_message so the agent sees the recent cron failures without adding a phantom turn to history. - Adds integration tests proving the digest reaches run_conversation and that it is skipped when no digest is available. Closes #433 Co-Authored-By: Hermes Evolution <evolution@hermes.ai>
Contributor
🔎 Lint report:
|
| Rule | Count |
|---|---|
unresolved-import |
2 |
unresolved-attribute |
2 |
not-subscriptable |
1 |
First entries
tests/cron/test_cron_failure_logging.py:21: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`
run_agent.py:3223: [unresolved-attribute] unresolved-attribute: Object of type `Self@get_credits_spent_micros` has no attribute `_credits_session_start_micros`
tests/cli/test_cron_failure_digest_integration.py:15: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`
tests/run_agent/test_credits_notices_toggle.py:76: [unresolved-attribute] unresolved-attribute: Unresolved attribute `_credits_session_start_micros` on type `AIAgent`
tests/cron/test_cron_failure_logging.py:91: [not-subscriptable] not-subscriptable: Cannot subscript object of type `None` with no `__getitem__` method
✅ Fixed issues (1):
| Rule | Count |
|---|---|
invalid-assignment |
1 |
First entries
tests/run_agent/test_credits_notices_toggle.py:76: [invalid-assignment] invalid-assignment: Object of type `None` is not assignable to attribute `_credits_session_start_micros` of type `int`
Unchanged: 5893 pre-existing issues carried over.
Diagnostics are surfaced as warnings — this check never fails the build.
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.
Rework of #433: the first slice persisted cron failures and added a digest builder, but the digest was dead code with no real call site. This PR wires it into the CLI user turn.
Closes #433