{"record":{"id":"cbbbc2055209f324","repo":"tinyhumansai/openhuman","slug":"failed-to-persist-suggestions-e","errorCode":null,"errorMessage":"failed to persist suggestions: {e}","messagePattern":"failed to persist suggestions: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/flows/discovery_tools.rs","lineNumber":279,"sourceCode":"            });\n        }\n\n        // Dedupe within this single batch on id, keeping the first (highest\n        // ranked) occurrence, so two near-identical titles in one call don't\n        // fight over the same row.\n        suggestions.dedup_by(|a, b| a.id == b.id);\n        let mut seen = std::collections::HashSet::new();\n        suggestions.retain(|s| seen.insert(s.id.clone()));\n\n        tracing::info!(\n            target: \"flows\",\n            count = suggestions.len(),\n            run_id = run_id.as_deref().unwrap_or(\"-\"),\n            \"[flows] suggest_workflows: recording discovered suggestions\"\n        );\n\n        let written = store::upsert_suggestions(&self.config, &suggestions)\n            .map_err(|e| anyhow::anyhow!(\"failed to persist suggestions: {e}\"))?;\n\n        let payload = json!({\n            \"type\": \"workflow_suggestions\",\n            \"count\": written,\n            \"suggestions\": suggestions,\n        });\n\n        Ok(ToolResult::success(serde_json::to_string_pretty(&payload)?))\n    }\n}\n\n#[cfg(test)]\n#[path = \"discovery_tools_tests.rs\"]\nmod tests;\n","sourceCodeStart":261,"sourceCodeEnd":294,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/flows/discovery_tools.rs#L261-L294","documentation":"Persisting a deduplicated batch of discovered workflow suggestions to the suggestion store failed after discovery itself succeeded. The count/run_id were already logged; the wrap preserves the store error while the in-memory discovery result may still be returned — suggestions just won't survive restart.","triggerScenarios":"Thrown at src/openhuman/flows/discovery_tools.rs:279 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the suggestion store (flows.db) is writable","Inspect the wrapped error for the SQLite cause","Re-run discovery after fixing the store"],"exampleFix":null,"handlingStrategy":"try-catch","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"}