tinyhumansai/openhuman · error

Source workspace matches current OpenHuman workspace; refusi

Error message

Source workspace matches current OpenHuman workspace; refusing self-migration

What it means

Self-migration guard in `migrate_openclaw_memory`: after resolving the source workspace, `paths_equal` compares it with `config.workspace_dir` (the active OpenHuman workspace) and bails on a match. Importing a workspace onto itself would re-import the app's own memory into itself and could duplicate or corrupt data, so the operation is refused up front.

Source

Thrown at src/openhuman/config/migration_helpers/core.rs:51

    pub stats: MigrationStats,
    pub warnings: Vec<String>,
}

pub async fn migrate_openclaw_memory(
    config: &Config,
    source_workspace: Option<PathBuf>,
    dry_run: bool,
) -> Result<MigrationReport> {
    let source_workspace = resolve_openclaw_workspace(source_workspace)?;
    if !source_workspace.exists() {
        bail!(
            "OpenClaw workspace not found at {}. Provide a valid source workspace.",
            source_workspace.display()
        );
    }

    if paths_equal(&source_workspace, &config.workspace_dir) {
        bail!("Source workspace matches current OpenHuman workspace; refusing self-migration");
    }

    let mut stats = MigrationStats::default();
    let entries = collect_source_entries(&source_workspace, &mut stats)?;
    let mut warnings = Vec::new();

    if entries.is_empty() {
        warnings.push(format!(
            "No importable memory found in {}",
            source_workspace.display()
        ));
        warnings.push("Checked for: memory/brain.db, MEMORY.md, memory/*.md".to_string());
        return Ok(MigrationReport {
            source_workspace,
            target_workspace: config.workspace_dir.clone(),
            dry_run,
            stats,
            warnings,

View on GitHub (pinned to 7491200858)

Solutions

  1. Point `source_workspace` at the original OpenClaw data location, distinct from the OpenHuman workspace.
  2. If an in-place import is truly wanted, copy the source tree to a temp directory and migrate from the copy.
  3. Check env/config overrides (OPENHUMAN_WORKSPACE, workspace_dir) that make the two paths resolve identically and retarget them.

Example fix

# before — OpenHuman workspace pointed at the source data
OPENHUMAN_WORKSPACE=~/.openclaw/workspace openhuman-core ...

# after — separate destination, then migrate
OPENHUMAN_WORKSPACE=~/.openhuman/users/me/workspace openhuman-core \
  config.migrate_openclaw_memory --source ~/.openclaw/workspace
Defensive patterns

Strategy: validation

Validate before calling

let src = src.canonicalize()?;
let dst = config.workspace_dir.canonicalize()?;
if src == dst {
    // source and destination are the same tree — refuse before calling migrate
    return Ok(None);
}
let report = migrate_openclaw_memory(&config, Some(src), dry_run).await?;

Prevention

When it happens

Trigger: Passing a source path that equals the active OpenHuman workspace, or having `config.workspace_dir` (e.g. via OPENHUMAN_WORKSPACE) pointed at `~/.openclaw/workspace` so the default resolution collides with the destination.

Common situations: 'Migrate in place' setups where the OpenHuman workspace was deliberately pointed at the old app's data dir; symlinked or aliased paths that canonicalize to the same directory; copied workspaces that keep the same location.

Related errors


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