Skip to content

feat: wire cron failure digest into CLI user turn (Closes #433)#476

Merged
Lexus2016 merged 2 commits into
mainfrom
evolution/issue-433-cron-digest-integration
Jun 23, 2026
Merged

feat: wire cron failure digest into CLI user turn (Closes #433)#476
Lexus2016 merged 2 commits into
mainfrom
evolution/issue-433-cron-digest-integration

Conversation

@Lexus2016

Copy link
Copy Markdown
Owner

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.

  • Surfaces recent un-acked cron failures to the operator before the user message is sent.
  • Prepends the digest to the model's user_message so the agent sees the failures without adding a phantom turn.
  • Adds integration tests proving the digest reaches run_conversation.

Closes #433

Hermes Evolution 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>
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: evolution/issue-433-cron-digest-integration vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 11215 on HEAD, 11210 on base (🆕 +5)

🆕 New issues (5):

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.

@Lexus2016 Lexus2016 merged commit 8593a3e into main Jun 23, 2026
39 checks passed
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 Job Silent Failures — 61% of Scheduled Tasks Fail Silently

1 participant