{"record":{"id":"c59de00b2f8a5e31","repo":"tinyhumansai/openhuman","slug":"no-pending-approval-found-for-request-id-request","errorCode":null,"errorMessage":"no pending approval found for request_id '{request_id}' (already decided or expired)","messagePattern":"no pending approval found for request_id '(.+?)' \\(already decided or expired\\)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/security/approval/rpc.rs","lineNumber":236,"sourceCode":"    };\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\n            // (TAURI-RUST-5EH). Both stay `warn!` — neither is a hard error the\n            // caller can act on differently — but the benign arm emits the\n            // \"no pending approval found\" wording that `expected_error_kind`\n            // demotes, while the never-registered arm emits a distinct string\n            // that stays a captured Sentry signal.\n            return match gate.classify_decide_miss(request_id) {\n                DecideMiss::AlreadyResolved => {\n                    tracing::warn!(\n                        request_id = request_id,\n                        \"[rpc:approval_decide] no pending approval found (already decided/expired — benign race)\"\n                    );\n                    Err(anyhow!(\n                        \"no pending approval found for request_id '{request_id}' (already decided or expired)\"\n                    ))\n                }\n                DecideMiss::NeverRegistered => {\n                    tracing::warn!(\n                        request_id = request_id,\n                        \"[rpc:approval_decide] no pending approval ever registered (genuine lost registration)\"\n                    );\n                    Err(anyhow!(\n                        \"no pending approval ever registered for request_id '{request_id}'\"\n                    ))\n                }\n            };\n        }\n    };\n\n    let mut logs = vec![format!(\n        \"[approval] decided request_id={} tool={} decision={}\",","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/security/approval/rpc.rs#L218-L254","documentation":"Input-validation guard in approval_preauthorize_flow: the flow_id argument is an empty string, so pre-authorization rows could not be attributed to any flow. The RPC rejects the call before touching the approval gate or database; the faulting input is an empty flow_id from the caller (dashboard/flows UI).","triggerScenarios":"Thrown at src/openhuman/security/approval/rpc.rs:236 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the actual persisted flow id of the flow being saved/enabled.","Ensure the flow is saved and has an id before requesting pre-authorization.","Fix callers that default flow_id to an empty string."],"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-14T00:17:10.932Z"}