AprilNEA/OpenLogi · error

the running Agent disconnected while providing its device…

Error message

the running Agent disconnected while providing its device snapshot

What it means

The inner-error sibling of [78]: the `snapshot` tarpc call returned `Err`, i.e. the agent dropped the connection or the request failed server-side while producing the device snapshot. No capture proceeds and no profile is written.

Solutions

  1. Retry once the agent is stable and confirmed running
  2. Restart the agent and check its logs for an enumeration panic/error
  3. Align CLI and agent versions (wire-format compatibility, `PROTOCOL_VERSION`)
  4. Re-run capture avoiding concurrent agent shutdown (e.g. GUI updates, autostart restarts)
Defensive patterns

Strategy: retry

Validate before calling

// verify the agent survives a snapshot probe
let pid = agent_pid();
let _ = snapshot_probe().await;
if agent_pid() != pid {
    eprintln!("agent died during snapshot; inspect its logs before capture");
}

Try / catch

match capture_connected_profile(&conn, ...).await {
    Err(e) if e.to_string().contains("disconnected while providing its device snapshot") => {
        eprintln!("agent dropped mid-snapshot; check logs, align versions, retry");
    }
    other => other,
}

Prevention

When it happens

Trigger: The agent's connection breaks or it returns an error while servicing `snapshot()` — agent crash mid-enumeration, serialization failure of the snapshot payload, or the agent shutting down during capture.

Common situations: Agent crash-looping; a device error inside the agent's enumeration causing the tarpc task to abort; killing/quitting the GUI/agent during record; version skew making the snapshot payload fail to serialize/deserialize.

Related errors


AI-assisted analysis of AprilNEA/OpenLogi@e846e6f4b4 (2026-09-13). Data as JSON: /api/errors/3982227cf0efc1f5. Report an issue: GitHub.

Appendix: source

Thrown at crates/openlogi-cli/src/cmd/fixture/record_profile.rs:151

    }

    tokio::time::timeout(
        DECLARE_TIMEOUT,
        connection
            .client
            .declare_client(context::current(), ClientKind::Cli),
    )
    .await
    .map_err(|_| anyhow!("the running Agent timed out before semantic capture could begin"))?
    .map_err(|_| anyhow!("the running Agent disconnected before semantic capture could begin"))?;

    let snapshot = tokio::time::timeout(
        SNAPSHOT_TIMEOUT,
        connection.client.snapshot(context::current()),
    )
    .await
    .map_err(|_| anyhow!("the running Agent timed out while providing its device snapshot"))?
    .map_err(|_| anyhow!("the running Agent disconnected while providing its device snapshot"))?;

    let captured = capture_profile(&connection.client, snapshot, selector, id, name).await?;
    captured
        .profile
        .validate()
        .context("captured semantic profile failed version-1 validation; no profile was written")?;
    Ok(captured)
}

fn validate_metadata(args: &RecordProfileArgs) -> Result<()> {
    if args.id.trim().is_empty() {
        bail!("--id must be a nonempty synthetic identifier");
    }
    if args.name.trim().is_empty() {
        bail!("--name must be a nonempty synthetic profile name");
    }
    Ok(())
}

View on GitHub (pinned to e846e6f4b4)