{"record":{"id":"cf0500a441d78b48","repo":"tinyhumansai/openhuman","slug":"secret-ref-not-yet-fulfilled","errorCode":null,"errorMessage":"secret ref {} not yet fulfilled","messagePattern":"secret ref (.+?) not yet fulfilled","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/mcp/registry/setup.rs","lineNumber":186,"sourceCode":"/// Resolve a `{KEY: SecretRef}` map into a `Vec<(KEY, VALUE)>`. Returns\n/// `Err(_)` if any ref is unknown or not yet fulfilled — callers should\n/// retry rather than partially-apply.\n///\n/// Touches the `last_touched` on every hit so iterative `test_connection`\n/// calls reset the idle TTL.\npub async fn resolve_refs(\n    refs: &HashMap<String, SecretRef>,\n) -> anyhow::Result<Vec<(String, String)>> {\n    let mut guard = map().lock().await;\n    let mut out = Vec::with_capacity(refs.len());\n    for (key, r) in refs {\n        let entry = guard\n            .get_mut(r)\n            .ok_or_else(|| anyhow::anyhow!(\"unknown secret ref {}\", r.as_str()))?;\n        let value = entry\n            .value\n            .clone()\n            .ok_or_else(|| anyhow::anyhow!(\"secret ref {} not yet fulfilled\", r.as_str()))?;\n        entry.last_touched = Instant::now();\n        out.push((key.clone(), value));\n    }\n    Ok(out)\n}\n\n/// Same as [`resolve_refs`] but also removes the entries from the map on\n/// success. Used by `install_and_connect` once the values have been\n/// persisted to `mcp_client_env`. On failure the entries are left intact\n/// so the agent can retry without re-prompting.\npub async fn consume_refs(\n    refs: &HashMap<String, SecretRef>,\n) -> anyhow::Result<Vec<(String, String)>> {\n    // First pass: resolve. Bail without mutation if any ref is missing.\n    let resolved = resolve_refs(refs).await?;\n    // Second pass: drop. Bail-out on the first miss is impossible because\n    // we just held the resolved values without releasing the lock — but to\n    // be honest we *did* release between the two awaits. Recheck.","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/mcp/registry/setup.rs#L168-L204","documentation":"resolve_refs found the SecretRef in the map but its value slot is still empty — the user has not yet completed the interactive credential step. The doc comment instructs callers to retry rather than partially apply; last_touched is bumped so the idle TTL resets.","triggerScenarios":"Thrown at src/openhuman/mcp/registry/setup.rs:186 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Prompt the user to complete the pending authorization, then retry","Poll resolve_refs until the value is fulfilled (test_connection loops this way)","Abort the setup flow if the user cancels the authorization"],"exampleFix":null,"handlingStrategy":"retry","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"}