zeroclaw-labs/zeroclaw · error

AgentScopedMemory refuses to forget cross-agent row: key…

Error message

AgentScopedMemory refuses to forget cross-agent row: key attributed to agent other than the bound agent

What it means

Agent-isolation refusal in AgentScopedMemory::forget: the key exists but its row is attributed to a different agent than the wrapper's bound agent. The refusal is logged as a WARN Reject event before bailing; allowlists grant recall across agents, never deletion, so the delete is refused even if the key is visible.

Solutions

  1. Use a wrapper bound to the owning agent, or an admin Memory handle, to forget that key.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/zeroclaw-memory/src/agent_scoped.rs:302 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/ff0f1d482f07630c. Report an issue: GitHub.

Appendix: source

Thrown at crates/zeroclaw-memory/src/agent_scoped.rs:302

        if self.inner.forget_for_agent(key, &self.agent_id).await? {
            return Ok(true);
        }
        match self.inner.get(key).await? {
            None => Ok(false),
            Some(entry) => match entry.agent_id.as_deref() {
                Some(other) => {
                    ::zeroclaw_log::record!(
                        WARN,
                        ::zeroclaw_log::Event::new(module_path!(), ::zeroclaw_log::Action::Reject)
                            .with_outcome(::zeroclaw_log::EventOutcome::Failure)
                            .with_attrs(::serde_json::json!({
                                "key": key,
                                "row_agent": other,
                                "bound_agent": self.agent_id,
                            })),
                        "forget refused: row attributed to a different agent"
                    );
                    anyhow::bail!(
                        "AgentScopedMemory refuses to forget cross-agent row: key attributed to agent other than the bound agent"
                    );
                }
                None => {
                    ::zeroclaw_log::record!(
                        WARN,
                        ::zeroclaw_log::Event::new(module_path!(), ::zeroclaw_log::Action::Reject)
                            .with_outcome(::zeroclaw_log::EventOutcome::Failure)
                            .with_attrs(::serde_json::json!({
                                "key": key,
                                "bound_agent": self.agent_id,
                            })),
                        "forget refused: row has no agent attribution"
                    );
                    anyhow::bail!(
                        "AgentScopedMemory refuses to forget unattributed row: legacy or backend without per-agent tracking; resolve via an admin Memory handle"
                    );
                }

View on GitHub (pinned to 88bb9c8533)