zeroclaw-labs/zeroclaw · error

cli-alias-live-acp-sessions

cli-alias-live-acp-sessions

Error message

{$count} live ACP session(s) for `{$alias}` — end them first

What it means

Fail-closed precheck in agent_delete_precheck: live ACP sessions exist for the alias (or the session store could not be read to prove otherwise), so the agent delete is refused to avoid orphaning running sessions. Mirrors the gateway's own delete gate.

Solutions

  1. End the live ACP sessions for the alias first, then retry the operation.
  2. Restart the gateway or disconnect the listed ACP clients to clear the sessions.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/alias_cli/mod.rs:461 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/8f39a7efe89f8bb4. Report an issue: GitHub.

Appendix: source

Thrown at src/alias_cli/mod.rs:461

                &config.channels.session_backend,
            )
            .context("open session backend for the owned-state cascade")?,
        )
    } else {
        None
    };
    Ok((mem, session_backend))
}

#[cfg(all(feature = "gateway", feature = "agent-runtime"))]
fn agent_delete_precheck(config: &Config, alias: &str) -> Result<()> {
    // Fail closed: refuse if live ACP sessions exist, or if the store can't be
    // read to verify (mirrors the gateway delete gate).
    let live = crate::gateway::agent_owned_state::live_acp_session_count(config, alias)
        .context("could not verify live ACP sessions")?;
    if live > 0 {
        let count = live.to_string();
        bail!(
            "{}",
            mta(
                "cli-alias-live-acp-sessions",
                &[("count", count.as_str()), ("alias", alias)],
                "{$count} live ACP session(s) for `{$alias}` — end them first"
            )
        );
    }
    Ok(())
}

#[cfg(not(all(feature = "gateway", feature = "agent-runtime")))]
fn agent_delete_precheck(_config: &Config, _alias: &str) -> Result<()> {
    Ok(())
}

#[cfg(all(feature = "gateway", feature = "agent-runtime"))]
async fn agent_delete_owned_state(

View on GitHub (pinned to 88bb9c8533)