{"record":{"id":"5628b48e634a27ba","repo":"tinyhumansai/openhuman","slug":"approval-gate-is-not-installed-supervised-mode-di","errorCode":null,"errorMessage":"approval gate is not installed; supervised mode disabled","messagePattern":"approval gate is not installed; supervised mode disabled","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/security/approval/rpc.rs","lineNumber":206,"sourceCode":"}\n\n/// Apply a decision to a pending row. Errors when the request id is\n/// unknown / already decided / belongs to a different session.\npub async fn approval_decide(\n    request_id: &str,\n    decision: ApprovalDecision,\n) -> anyhow::Result<RpcOutcome<PendingApproval>> {\n    tracing::debug!(\n        request_id = request_id,\n        decision = decision.as_str(),\n        \"[rpc:approval_decide] entry\"\n    );\n    let gate = ApprovalGate::try_global().ok_or_else(|| {\n        tracing::warn!(\n            request_id = request_id,\n            \"[rpc:approval_decide] gate not installed\"\n        );\n        anyhow!(\"approval gate is not installed; supervised mode disabled\")\n    })?;\n    let decided = match gate.decide(request_id, decision) {\n        Ok(row) => row,\n        Err(err) => {\n            tracing::error!(\n                request_id = request_id,\n                error = %err,\n                \"[rpc:approval_decide] gate decide failed\"\n            );\n            return Err(err);\n        }\n    };\n    let row = match decided {\n        Some(row) => row,\n        None => {\n            // `gate.decide` returned `Ok(None)`: the conditional UPDATE matched\n            // 0 rows. Disambiguate the benign already-decided/expired race from\n            // a genuine lost registration so only the latter reaches Sentry","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/security/approval/rpc.rs#L188-L224","documentation":"Global-state guard in approval_decide: ApprovalGate::try_global() returns None because the approval gate was never installed in this process (e.g. OPENHUMAN_APPROVAL_GATE=0), yet a decision arrived. There is no pending-approval registry to apply the decision to, so the RPC fails instead of silently succeeding. The faulting condition is gate absence, not a bad request id.","triggerScenarios":"Thrown at src/openhuman/security/approval/rpc.rs:206 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Enable the approval gate (remove OPENHUMAN_APPROVAL_GATE=0 or set it to 1) and restart the core.","Do not send approval decisions when the gate is disabled; the UI should hide the approval card.","Check startup logs to confirm whether the gate was installed."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}