{"record":{"id":"cca784ab2f758395","repo":"AprilNEA/OpenLogi","slug":"the-running-agent-speaks-protocol-v-but-this-cli-requires-v","errorCode":null,"errorMessage":"the running Agent speaks protocol v{}, but this CLI requires v{PROTOCOL_VERSION}; update or restart OpenLogi so both processes match (no profile was written)","messagePattern":"the running Agent speaks protocol v(.+?), but this CLI requires v(.+?); update or restart OpenLogi so both processes match \\(no profile was written\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/fixture/record_profile.rs","lineNumber":128,"sourceCode":"        \"Recorded semantic profile `{}` to {} through the running Agent.\",\n        profile.id,\n        args.output.display()\n    );\n    println!(\n        \"The captured values are semantic review candidates, not proof of physical or protocol \\\n         correctness. Review the profile before committing it.\"\n    );\n    Ok(())\n}\n\nasync fn capture_connected_profile(\n    connection: &Connection,\n    selector: Option<&str>,\n    id: String,\n    name: String,\n) -> Result<CapturedProfile> {\n    if connection.version != PROTOCOL_VERSION {\n        bail!(\n            \"the running Agent speaks protocol v{}, but this CLI requires v{PROTOCOL_VERSION}; \\\n             update or restart OpenLogi so both processes match (no profile was written)\",\n            connection.version\n        );\n    }\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,","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/fixture/record_profile.rs#L110-L146","documentation":"After connecting, `capture_connected_profile` compares the agent's negotiated wire-protocol version against the CLI's `PROTOCOL_VERSION`. The IPC wire format is append-only and versioned; when the versions differ the CLI aborts before reading a profile so no partial or misinterpreted data is written. This error means the running agent and the CLI were built from mismatched versions of the codebase.","triggerScenarios":"Calling `record_profile` (via `capture_for_contribution`/`capture_connected`) against a running agent whose `connection.version` differs from the CLI's `PROTOCOL_VERSION` — typically an old agent still running after a rebuild or upgrade.","commonSituations":"Updating OpenLogi (bumping PROTOCOL_VERSION) while the old agent process is still alive (~20s self-restart window after a dev run); a dev-built CLI talking to a production agent or vice versa; a partial update where one binary was replaced but not the other.","solutions":["Quit/restart the running OpenLogi agent so it matches the CLI's build (restart the OpenLogi app or kill openlogi-agent and relaunch)","Update or reinstall OpenLogi so both binaries come from the same release","Rebuild both `openlogi-cli` and `openlogi-agent` from the same commit if developing","If a stale agent keeps relaunching, kill it and wait for the LaunchServices-launched replacement or start the GUI to relaunch it"],"exampleFix":"// before: agent from v1 bundle, CLI from v2 source\nconnection.version = 1, PROTOCOL_VERSION = 2  -> bail!\n// after\n$ pkill openlogi-agent && open /Applications/OpenLogi.app   # relaunch matching agent\n// wire check passes: connection.version == PROTOCOL_VERSION","handlingStrategy":"validation","validationCode":"// before capture, surface the mismatch clearly\nif connection.version != PROTOCOL_VERSION {\n    eprintln!(\"agent protocol v{}, CLI needs v{} — restart OpenLogi\", connection.version, PROTOCOL_VERSION);\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = run().await {\n    if e.to_string().contains(\"speaks protocol v\") && e.to_string().contains(\"requires v\") {\n        eprintln!(\"Version mismatch: restart the agent so it matches this CLI, then rerun.\");\n    }\n}","preventionTips":["After every rebuild or update, restart both the agent and CLI from the same build","Kill stale openlogi-agent processes after pulling new code; remember the agent self-restarts ~20s after a dev run","Never mix a production bundle agent with a dev-built CLI","Bump/check PROTOCOL_VERSION and openlogi-ipc wire_format tests together when touching wire types"],"tags":["ipc","protocol-version","agent","cli"],"backgroundTag":"protocol-version-mismatch","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"}