{"record":{"id":"fc91e7e3bbb1fe2b","repo":"AprilNEA/OpenLogi","slug":"timed-out-connecting-to-the-running-openlogi-agent-semantic","errorCode":null,"errorMessage":"timed out connecting to the running OpenLogi Agent; semantic profile capture requires a responsive Agent and will not access hardware directly","messagePattern":"timed out connecting to the running OpenLogi Agent; semantic profile capture requires a responsive Agent and will not access hardware directly","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/fixture/record_profile.rs","lineNumber":81,"sourceCode":"type ProfileCaptureParts = (\n    Vec<DeviceInventory>,\n    Vec<StandaloneDevice>,\n    Vec<ProfileDeviceSettings>,\n    DeviceRoute,\n);\n\npub(super) async fn capture_for_contribution(\n    id: String,\n    name: String,\n    selector: Option<&str>,\n) -> Result<CapturedProfile> {\n    let connection = connect_to_agent().await?;\n    capture_connected_profile(&connection, selector, id, name).await\n}\n\nasync fn connect_to_agent() -> Result<Connection> {\n    match tokio::time::timeout(CONNECT_TIMEOUT, client::connect()).await {\n        Err(_) => bail!(\n            \"timed out connecting to the running OpenLogi Agent; semantic profile capture \\\n             requires a responsive Agent and will not access hardware directly\"\n        ),\n        Ok(Err(error)) => Err(safe_connect_error(&error)),\n        Ok(Ok(connection)) => Ok(connection),\n    }\n}\n\nfn safe_connect_error(error: &ConnectError) -> anyhow::Error {\n    match error {\n        ConnectError::Endpoint(_) => anyhow!(\n            \"could not reach the running OpenLogi Agent; start the Agent and retry (semantic \\\n             profile capture has no direct-hardware fallback)\"\n        ),\n        ConnectError::Handshake(_) => anyhow!(\n            \"the running OpenLogi Agent did not complete a healthy IPC handshake; restart it and \\\n             retry (no profile was written)\"\n        ),","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/fixture/record_profile.rs#L63-L99","documentation":"Semantic profile capture (`record_profile`) refuses to talk to hardware directly; it requires the running OpenLogi Agent over IPC. `connect_to_agent` wraps the tarpc connect in a timeout, and this error is raised when the connection does not complete within CONNECT_TIMEOUT. It is a deliberate safety policy: capture must never bypass the agent and access HID devices itself.","triggerScenarios":"Running `openlogi fixture record-profile` (via `run`/`capture_for_contribution`) when the agent is not running, is hung, or its IPC socket is unreachable, so `client::connect()` does not resolve within CONNECT_TIMEOUT.","commonSituations":"The agent process was quit or crashed; a stale agent is stuck on a singleton lock; the user runs the CLI before launching the GUI/agent; the agent is an old build listening on a different socket version.","solutions":["Start the OpenLogi agent (or launch the OpenLogi app, which starts it) and retry the command","Check for a hung agent process (e.g. stuck on the singleton lock) and kill/restart it","Verify the dev environment: with OPENLOGI_DEV_AGENT set, the CLI expects the dev IPC socket — use the agent-mock or unset the override as appropriate","Rebuild/reinstall so the CLI and agent are from the same bundle and use the same socket path"],"exampleFix":"// before\n$ openlogi fixture record-profile --id syn-1   # agent not running\nerror: timed out connecting to the running OpenLogi Agent; ...\n// after\n$ openlogi-agent &          # or launch the OpenLogi app\n$ openlogi fixture record-profile --id syn-1","handlingStrategy":"retry","validationCode":"// shell pre-check before running the CLI\nif ! pgrep -x openlogi-agent >/dev/null; then echo \"agent not running; start OpenLogi first\"; fi","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"timed out connecting to the running OpenLogi Agent\") => {\n        start_or_restart_agent();\n        retry_with_backoff(connect_to_agent, 3);\n    }\n    other => other,\n}","preventionTips":["Launch the OpenLogi app (or openlogi-agent) before fixture commands in scripts","Add a health/ readiness wait on the agent socket before invoking capture","In dev, use OPENLOGI_DEV_AGENT=0 intentionally and know which socket you target","Use the agent-mock (openlogi-agent-mock) when no hardware/agent is available"],"tags":["ipc","timeout","agent"],"backgroundTag":"request-timeout","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"}