tinyhumansai/openhuman · error · anyhow::Error

no pending approval found for request_id '{request_id}' (alr

Error message

no pending approval found for request_id '{request_id}' (already decided or expired)

What it means

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).

Source

Thrown at src/openhuman/security/approval/rpc.rs:236

    };
    let row = match decided {
        Some(row) => row,
        None => {
            // `gate.decide` returned `Ok(None)`: the conditional UPDATE matched
            // 0 rows. Disambiguate the benign already-decided/expired race from
            // a genuine lost registration so only the latter reaches Sentry
            // (TAURI-RUST-5EH). Both stay `warn!` — neither is a hard error the
            // caller can act on differently — but the benign arm emits the
            // "no pending approval found" wording that `expected_error_kind`
            // demotes, while the never-registered arm emits a distinct string
            // that stays a captured Sentry signal.
            return match gate.classify_decide_miss(request_id) {
                DecideMiss::AlreadyResolved => {
                    tracing::warn!(
                        request_id = request_id,
                        "[rpc:approval_decide] no pending approval found (already decided/expired — benign race)"
                    );
                    Err(anyhow!(
                        "no pending approval found for request_id '{request_id}' (already decided or expired)"
                    ))
                }
                DecideMiss::NeverRegistered => {
                    tracing::warn!(
                        request_id = request_id,
                        "[rpc:approval_decide] no pending approval ever registered (genuine lost registration)"
                    );
                    Err(anyhow!(
                        "no pending approval ever registered for request_id '{request_id}'"
                    ))
                }
            };
        }
    };

    let mut logs = vec![format!(
        "[approval] decided request_id={} tool={} decision={}",

View on GitHub (pinned to 7491200858)

Solutions

  1. Pass the actual persisted flow id of the flow being saved/enabled.
  2. Ensure the flow is saved and has an id before requesting pre-authorization.
  3. Fix callers that default flow_id to an empty string.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/security/approval/rpc.rs:236 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/c59de00b2f8a5e31. Report an issue: GitHub.