tinyhumansai/openhuman · error · anyhow::Error

memory_forget: {e}

Error message

memory_forget: {e}

What it means

Error-surfacing wrapper at the end of memory_forget's execute: the underlying store/driver delete (tried first as split namespace+key, then as the legacy packed `namespace/key` form) returned an error, which is re-wrapped with the memory_forget prefix. Unlike the parameter guards this fires after the Act-permission check passed, so the tool was authorized but the deletion itself failed (e.g. key not found is handled separately; this is a real store error).

Source

Thrown at src/openhuman/memory/tools/forget.rs:78

            .ok_or_else(|| anyhow::anyhow!("Missing 'key' parameter"))?;

        if let Err(error) = self
            .security
            .enforce_tool_operation(ToolOperation::Act, "memory_forget")
        {
            return Ok(ToolResult::error(error));
        }

        let namespace = namespace.trim();
        let legacy_key = format!("{namespace}/{key}");
        let display_key = format!("{namespace}/{key}");

        // Try the new split namespace/key first (covers post-migration rows),
        // then fall back to the legacy packed-key shape for rows that were
        // stored before the boot migration ran (Phase A compatibility).
        let guard = active_memory_guard()
            .await
            .map_err(|e| anyhow::anyhow!("memory_forget: {e}"))?;
        let deleted = match guard.forget(namespace, key).await {
            Ok(true) => true,
            Ok(false) => match guard.forget("", &legacy_key).await {
                Ok(deleted) => deleted,
                Err(e) => return Ok(ToolResult::error(format!("Failed to forget memory: {e}"))),
            },
            Err(e) => return Ok(ToolResult::error(format!("Failed to forget memory: {e}"))),
        };

        if deleted {
            Ok(ToolResult::success(format!("Forgot memory: {display_key}")))
        } else {
            Ok(ToolResult::success(format!(
                "No memory found with key: {display_key}"
            )))
        }
    }
}

View on GitHub (pinned to 7491200858)

Solutions

  1. Read the chained error: a missing row should be surfaced as not-found, not retried blindly
  2. Retry on transient store locks or busy database errors
  3. Verify the namespace/key combination exists with a recall first
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/openhuman/memory/tools/forget.rs:78 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/0d408644fe1f03d3. Report an issue: GitHub.