{"record":{"id":"3982227cf0efc1f5","repo":"AprilNEA/OpenLogi","slug":"the-running-agent-disconnected-while-providing-its-device","errorCode":null,"errorMessage":"the running Agent disconnected while providing its device snapshot","messagePattern":"the running Agent disconnected while providing its device snapshot","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/fixture/record_profile.rs","lineNumber":151,"sourceCode":"    }\n\n    tokio::time::timeout(\n        DECLARE_TIMEOUT,\n        connection\n            .client\n            .declare_client(context::current(), ClientKind::Cli),\n    )\n    .await\n    .map_err(|_| anyhow!(\"the running Agent timed out before semantic capture could begin\"))?\n    .map_err(|_| anyhow!(\"the running Agent disconnected before semantic capture could begin\"))?;\n\n    let snapshot = tokio::time::timeout(\n        SNAPSHOT_TIMEOUT,\n        connection.client.snapshot(context::current()),\n    )\n    .await\n    .map_err(|_| anyhow!(\"the running Agent timed out while providing its device snapshot\"))?\n    .map_err(|_| anyhow!(\"the running Agent disconnected while providing its device snapshot\"))?;\n\n    let captured = capture_profile(&connection.client, snapshot, selector, id, name).await?;\n    captured\n        .profile\n        .validate()\n        .context(\"captured semantic profile failed version-1 validation; no profile was written\")?;\n    Ok(captured)\n}\n\nfn validate_metadata(args: &RecordProfileArgs) -> Result<()> {\n    if args.id.trim().is_empty() {\n        bail!(\"--id must be a nonempty synthetic identifier\");\n    }\n    if args.name.trim().is_empty() {\n        bail!(\"--name must be a nonempty synthetic profile name\");\n    }\n    Ok(())\n}","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/fixture/record_profile.rs#L133-L169","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Retry once the agent is stable and confirmed running","Restart the agent and check its logs for an enumeration panic/error","Align CLI and agent versions (wire-format compatibility, `PROTOCOL_VERSION`)","Re-run capture avoiding concurrent agent shutdown (e.g. GUI updates, autostart restarts)"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// verify the agent survives a snapshot probe\nlet pid = agent_pid();\nlet _ = snapshot_probe().await;\nif agent_pid() != pid {\n    eprintln!(\"agent died during snapshot; inspect its logs before capture\");\n}","typeGuard":null,"tryCatchPattern":"match capture_connected_profile(&conn, ...).await {\n    Err(e) if e.to_string().contains(\"disconnected while providing its device snapshot\") => {\n        eprintln!(\"agent dropped mid-snapshot; check logs, align versions, retry\");\n    }\n    other => other,\n}","preventionTips":["Keep CLI and agent wire-format compatible (PROTOCOL_VERSION, wire_format tests)","Fix agent-side enumeration panics surfaced in logs before re-running capture","Avoid terminating the GUI/agent while a record session is active"],"tags":["cli","ipc","agent","disconnection","snapshot"],"backgroundTag":"broken-pipe","analyzedSha":"e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8","analyzedAt":"2026-09-13T03:07:16.451Z","contentChangedAt":"2026-09-13T03:07:16.451Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}