{"record":{"id":"1516fb5f5ac604d0","repo":"NousResearch/hermes-agent","slug":"agent-reported-failure","errorCode":null,"errorMessage":"agent reported failure","messagePattern":"agent reported failure","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"cron/scheduler.py","lineNumber":4548,"sourceCode":"        # on these paths and may put the error into `final_response`, which\n        # would otherwise be delivered as if it were the agent's reply and the\n        # job's `last_status` set to \"ok\". Raise so the except handler below\n        # builds the proper failure tuple. (issue #17855)\n        turn_exit_reason = str(result.get(\"turn_exit_reason\") or \"\")\n        final_response_text = (result.get(\"final_response\") or \"\").strip()\n        max_iteration_summary = (\n            result.get(\"failed\") is not True\n            and result.get(\"completed\") is False\n            and turn_exit_reason.startswith(\"max_iterations_reached(\")\n            and bool(final_response_text)\n        )\n        if result.get(\"failed\") is True or (result.get(\"completed\") is False and not max_iteration_summary):\n            _err_text = (\n                result.get(\"error\")\n                or final_response_text\n                or \"agent reported failure\"\n            )\n            raise RuntimeError(_err_text)\n        if max_iteration_summary:\n            logger.warning(\n                \"Job '%s' reached the iteration limit but produced a final fallback response; \"\n                \"delivering the response instead of failing the cron run\",\n                job_name,\n            )\n\n        final_response = result.get(\"final_response\", \"\") or \"\"\n        # Strip leaked placeholder text that upstream may inject on empty completions.\n        if final_response.strip() == \"(No response generated)\":\n            final_response = \"\"\n        # Cron silence on abnormal empty turns.  The turn-completion explainer\n        # (#34452) replaces a blank/empty model turn with a \"⚠️ No reply: …\"\n        # string so interactive surfaces (CLI/gateway) explain why the box is\n        # empty.  In a cron context that turns a previously-silent empty turn\n        # into a delivered warning (Manfredi's Telegram symptom).  Detect the\n        # explainer text deterministically (via the same formatter that\n        # produced it) and treat it as empty so the empty-response suppression","sourceCodeStart":4530,"sourceCodeEnd":4566,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/cron/scheduler.py#L4530-L4566","documentation":"Error \"agent reported failure\" thrown in NousResearch/hermes-agent.","triggerScenarios":"Thrown at cron/scheduler.py:4548 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the job's session/logs for the agent's reported failure reason.","Fix the underlying prompt/tool/provider issue and rerun the job."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}