Skip to content

The agent that grows with you

test(cron): trim the failure-marker tests to two invariants; document [CRON_FAILURE]

teknium10a425ddb07f3
diff --git a/tests/cron/test_run_one_job.py b/tests/cron/test_run_one_job.py
index bc688c8d854..ec95a0efdcb 100644
--- a/tests/cron/test_run_one_job.py
+++ b/tests/cron/test_run_one_job.py
@@ -104,15 +104,6 @@ def test_run_one_job_marker_mentioned_in_report_stays_successful(monkeypatch):
assert calls[-1] == ("mark", "quoted-marker", True)
-def test_run_one_job_no_agent_does_not_interpret_failure_marker(monkeypatch):
- """Script-only jobs do not opt into agent response control tokens."""
- calls = _patch_pipeline(monkeypatch, final="[CRON_FAILURE]\nscript output")
-
- s.run_one_job({"id": "script-only", "name": "script", "no_agent": True, "deliver": "telegram"})
-
- assert calls[-1] == ("mark", "script-only", True)
-
-
def test_run_one_job_exception_delivers_failure_alert(monkeypatch):
"""An exception escaping the run body must not become a silent error row."""
delivered = []
diff --git a/tests/cron/test_scheduler.py b/tests/cron/test_scheduler.py
index 328dcb02df3..3eb0bf83736 100644
--- a/tests/cron/test_scheduler.py
+++ b/tests/cron/test_scheduler.py
@@ -1699,7 +1699,7 @@ class TestOneShotDispatchClaim:
class TestBuildJobPromptSilentHint:
- """Verify _build_job_prompt injects cron response control guidance."""
+ """Verify _build_job_prompt always injects [SILENT] guidance."""
def test_hint_always_present(self):
job = {"prompt": "Check for updates"}
@@ -1707,12 +1707,6 @@ class TestBuildJobPromptSilentHint:
assert "[SILENT]" in result
assert "Check for updates" in result
- def test_failure_marker_guidance_is_present(self):
- result = _build_job_prompt({"prompt": "Check delegated work"})
-
- assert "[CRON_FAILURE]" in result
- assert "first line by itself" in result
-
class TestBuildJobPromptRecursionGuard:
"""Verify _build_job_prompt tells the agent this is an execution, not a
diff --git a/website/docs/user-guide/features/cron.md b/website/docs/user-guide/features/cron.md
index 2b89483b16f..71c16a6060e 100644
--- a/website/docs/user-guide/features/cron.md
+++ b/website/docs/user-guide/features/cron.md
@@ -749,6 +749,24 @@ Otherwise, report the issue.
Failed jobs always deliver regardless of the `[SILENT]` marker — only successful runs can be silenced. For quiet monitoring jobs, prompt the agent to reply with only `[SILENT]` when there is nothing to report.
+### Declaring a failed run
+
+Only runtime failures (exceptions, timeouts, an unreachable model) mark a run as failed. When the agent itself
+finishes its turn but the work did not get done — for example a delegated subagent or a script it ran failed —
+it can declare the run failed by putting `[CRON_FAILURE]` alone on the **first line** of its response, followed
+by the explanation:
+
+```text
+[CRON_FAILURE]
+The nightly export subagent exited with "disk full"; no report was produced.
+```
+
+The run is then recorded as failed (`last_status`, failure streak, `hermes cron runs` and `hermes cron incidents`
+all reflect it) and the failure notice is delivered like any other failed run. The full response is still saved
+under `~/.hermes/cron/output/` for triage. The marker is strict: mentioning or quoting `[CRON_FAILURE]` anywhere
+else in a report leaves the run successful. Script-only (`no_agent`) jobs ignore it — a script signals failure
+with a non-zero exit code.
+
## Script timeout
Pre-run scripts (attached via the `script` parameter) have a default timeout of 3600 seconds (1 hour). This bounds the **script only** — skill-based / LLM-driven jobs run on a separate inactivity budget and are not capped by this value. If your scripts need a different limit, you can change it: