{"record":{"id":"dc6ce12518a672d8","repo":"NousResearch/hermes-agent","slug":"agent-run-conversation-returned-type-result-na","errorCode":null,"errorMessage":"agent.run_conversation returned {type(result).__name__} instead of dict: {result!r}","messagePattern":"agent\\.run_conversation returned (.+?) instead of dict: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"cron/scheduler.py","lineNumber":4523,"sourceCode":"            _iter_max = _activity.get(\"max_iterations\", 0)\n\n            logger.error(\n                \"Job '%s' idle for %.0fs (inactivity limit %.0fs) \"\n                \"| last_activity=%s | iteration=%s/%s | tool=%s\",\n                job_name, _secs_ago, _cron_inactivity_limit,\n                _last_desc, _iter_n, _iter_max,\n                _cur_tool or \"none\",\n            )\n            request_hard_interrupt(agent, \"Cron job timed out (inactivity)\")\n            raise TimeoutError(\n                f\"Cron job '{job_name}' idle for \"\n                f\"{int(_secs_ago)}s (limit {int(_cron_inactivity_limit)}s) \"\n                f\"— last activity: {_last_desc}\"\n            )\n\n        # Guard against non-dict returns from run_conversation under error conditions\n        if not isinstance(result, dict):\n            raise RuntimeError(\n                f\"agent.run_conversation returned {type(result).__name__} instead of dict: {result!r}\"\n            )\n\n        # If the agent itself reported failure (e.g. all retries exhausted on\n        # API errors, model abort, mid-run interrupt), do not silently mark the\n        # job as successful. run_agent populates `failed=True`/`completed=False`\n        # 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        )","sourceCodeStart":4505,"sourceCodeEnd":4541,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/cron/scheduler.py#L4505-L4541","documentation":"Error \"agent.run_conversation returned {type(result).__name__} instead of dict: {result!r}\" thrown in NousResearch/hermes-agent.","triggerScenarios":"Thrown at cron/scheduler.py:4523 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Report the bug: run_conversation must return a dict; check agent logs for the malformed return.","Retry the job; a transient internal error may have produced the wrong type."],"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"}