{"record":{"id":"3012be6de62c74e4","repo":"tinyhumansai/openhuman","slug":"failed-to-open-memory-client-for-notion-cleanup-ta","errorCode":null,"errorMessage":"failed to open memory client for notion cleanup target discovery: {error}","messagePattern":"failed to open memory client for notion cleanup target discovery: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/integrations/composio/ops/memory_cleanup.rs","lineNumber":92,"sourceCode":"\nfn gmail_memory_sources_for_connection(connection_id: &str) -> Vec<MemoryCleanupTarget> {\n    vec![\n        MemoryCleanupTarget::Owner(SourceKind::Email, format!(\"gmail-sync:{connection_id}\")),\n        MemoryCleanupTarget::Exact(SourceKind::Email, format!(\"gmail:{connection_id}\")),\n        MemoryCleanupTarget::Prefix(SourceKind::Email, format!(\"gmail:{connection_id}:\")),\n        MemoryCleanupTarget::Prefix(SourceKind::Email, format!(\"gmail:{connection_id}/\")),\n    ]\n}\n\nasync fn notion_memory_targets_for_connection(\n    config: &Config,\n    connection_id: &str,\n) -> anyhow::Result<Vec<MemoryCleanupTarget>> {\n    let mut targets = connection_scoped_document_targets(\"notion\", connection_id);\n\n    let memory = Arc::new(\n        MemoryClient::from_workspace_dir(config.workspace_dir.clone()).map_err(|error| {\n            anyhow::anyhow!(\n                \"failed to open memory client for notion cleanup target discovery: {error}\"\n            )\n        })?,\n    );\n    let adapter = tinymemory_core::tinycortex::HostSyncAdapter::new(memory);\n    let state = tinycortex::memory::sync::SyncState::load(&adapter, \"notion\", connection_id)\n        .await\n        .map_err(|error| {\n            anyhow::anyhow!(\"failed to load notion sync state for memory cleanup: {error}\")\n        })?;\n    for raw_id in state.synced_ids {\n        let Some(page_id) = notion_synced_page_id(&raw_id) else {\n            continue;\n        };\n        targets.push(MemoryCleanupTarget::Exact(\n            SourceKind::Document,\n            format!(\"notion:{page_id}\"),\n        ));","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/integrations/composio/ops/memory_cleanup.rs#L74-L110","documentation":"During connection deletion, notion_memory_targets_for_connection could not open a MemoryClient against the workspace dir when discovering which memory sources to clean up for the notion connection. Target discovery aborts, so the delete cannot proceed safely.","triggerScenarios":"Thrown at src/openhuman/integrations/composio/ops/memory_cleanup.rs:92 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the workspace dir is accessible and not locked by another process","Retry the disconnect — transient store open failures occur if the memory module is mid-operation","Inspect the underlying {error} for a corrupted-store or permission cause"],"exampleFix":null,"handlingStrategy":"fallback","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"}