{"record":{"id":"6dd37d1f7691151f","repo":"NousResearch/hermes-agent","slug":"failed-to-invoke-op-exc","errorCode":null,"errorMessage":"failed to invoke op: {exc}","messagePattern":"failed to invoke op: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"agent/secret_sources/onepassword.py","lineNumber":296,"sourceCode":"    # an `op` flag even if validation is ever loosened.\n    cmd += [\"--\", reference]\n\n    try:\n        proc = subprocess.run(  # noqa: S603 — op path is user-trusted, argv list\n            cmd,\n            env=_op_child_env(token_value),\n            capture_output=True,\n            text=True,\n            encoding=\"utf-8\",\n            errors=\"replace\",\n            timeout=_OP_RUN_TIMEOUT,\n        )\n    except subprocess.TimeoutExpired as exc:\n        raise RuntimeError(\n            f\"op read timed out after {_OP_RUN_TIMEOUT}s for {reference!r}\"\n        ) from exc\n    except OSError as exc:\n        raise RuntimeError(f\"failed to invoke op: {exc}\") from exc\n\n    if proc.returncode != 0:\n        err = _scrub(proc.stderr or \"\")[:200]\n        if err:\n            raise RuntimeError(f\"op read failed for {reference!r}: {err}\")\n        raise RuntimeError(\n            f\"op read exited {proc.returncode} for {reference!r}\"\n        )\n\n    # `op` appends a trailing newline; strip only that so a value with\n    # intentional internal/edge spaces survives.  But a value that is empty or\n    # whitespace-only is treated as empty: applying it would silently clobber a\n    # good .env/shell credential with effectively nothing.\n    value = (proc.stdout or \"\").rstrip(\"\\r\\n\")\n    if not value.strip():\n        raise RuntimeError(f\"op read returned an empty value for {reference!r}\")\n    return value\n","sourceCodeStart":278,"sourceCodeEnd":314,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/agent/secret_sources/onepassword.py#L278-L314","documentation":"Error \"failed to invoke op: {exc}\" thrown in NousResearch/hermes-agent.","triggerScenarios":"Thrown at agent/secret_sources/onepassword.py:296 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the op binary path and permissions.","Review the invocation error, fix the environment, and retry."],"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-15T17:31:12.345Z"}