tinyhumansai/openhuman · error

failed to persist suggestions: {e}

Error message

failed to persist suggestions: {e}

What it means

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.

Source

Thrown at src/openhuman/flows/discovery_tools.rs:279

            });
        }

        // Dedupe within this single batch on id, keeping the first (highest
        // ranked) occurrence, so two near-identical titles in one call don't
        // fight over the same row.
        suggestions.dedup_by(|a, b| a.id == b.id);
        let mut seen = std::collections::HashSet::new();
        suggestions.retain(|s| seen.insert(s.id.clone()));

        tracing::info!(
            target: "flows",
            count = suggestions.len(),
            run_id = run_id.as_deref().unwrap_or("-"),
            "[flows] suggest_workflows: recording discovered suggestions"
        );

        let written = store::upsert_suggestions(&self.config, &suggestions)
            .map_err(|e| anyhow::anyhow!("failed to persist suggestions: {e}"))?;

        let payload = json!({
            "type": "workflow_suggestions",
            "count": written,
            "suggestions": suggestions,
        });

        Ok(ToolResult::success(serde_json::to_string_pretty(&payload)?))
    }
}

#[cfg(test)]
#[path = "discovery_tools_tests.rs"]
mod tests;

View on GitHub (pinned to 7491200858)

Solutions

  1. Check the suggestion store (flows.db) is writable
  2. Inspect the wrapped error for the SQLite cause
  3. Re-run discovery after fixing the store
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/openhuman/flows/discovery_tools.rs:279 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/cbbbc2055209f324. Report an issue: GitHub.