{"record":{"id":"af3b02f177e94311","repo":"astrid-runtime/astrid","slug":"unexpected-daemon-response-other","errorCode":null,"errorMessage":"unexpected daemon response: {other:?}","messagePattern":"unexpected daemon response: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/capsule/install_daemon.rs","lineNumber":246,"sourceCode":"            }\n            let version = output\n                .get(\"installed_version\")\n                .and_then(serde_json::Value::as_str)\n                .unwrap_or(manifest.package.version.as_str())\n                .to_owned();\n            let wasm_hash = output\n                .get(\"wasm_hash\")\n                .and_then(serde_json::Value::as_str)\n                .map(str::to_owned);\n            Ok(InstalledCapsuleOutcome {\n                id: capsule_id,\n                version,\n                wasm_hash,\n                skipped: false,\n            })\n        },\n        KernelResponse::Error(message) => bail!(\"daemon rejected capsule install: {message}\"),\n        other => bail!(\"unexpected daemon response: {other:?}\"),\n    }\n}\n\nfn resume_generation_from_receipt(\n    receipt: Option<CapsuleInstallResumeReceipt>,\n    expected_id: &CapsuleId,\n    source_digest: &str,\n    expected_generation_hint: Option<&InstalledCapsuleGeneration>,\n) -> Option<InstalledCapsuleGeneration> {\n    let receipt = receipt?;\n    if receipt.id != expected_id.as_str()\n        || !is_digest(source_digest)\n        || receipt.archive_digest != source_digest\n        || !is_generation_well_formed(&receipt.generation)\n        || expected_generation_hint.is_some_and(|hint| hint != &receipt.generation)\n    {\n        return None;\n    }","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/capsule/install_daemon.rs#L228-L264","documentation":"The catch-all arm of the KernelResponse match in install_local_via_daemon_for_target_with_generation. Any daemon reply that is neither the expected success shape nor KernelResponse::Error bails with a debug dump of the reply. This protects the install flow from protocol desynchronization.","triggerScenarios":"install_local_via_daemon_for_target receives a KernelResponse variant the install handler doesn't recognize (e.g. a progress/intermediate response, or a response added by a newer daemon).","commonSituations":"Daemon and CLI version skew introducing new KernelResponse variants; misrouted responses from a shared daemon connection; bug in request routing returning the wrong reply type.","solutions":["Check the {other:?} dump to identify the unexpected KernelResponse variant.","Align CLI and daemon versions (upgrade both to the same release).","Retry the install on a fresh daemon connection.","If the variant is legitimate, report/patch the match to handle it."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"fn is_expected_kernel_response(r: &KernelResponse) -> bool { matches!(r, KernelResponse::Installed{..} | KernelResponse::Error(_)) }","tryCatchPattern":"on 'unexpected daemon response', restart the daemon connection and retry once; if it persists, capture the {other:?} dump for a bug report.","preventionTips":["Upgrade CLI and daemon together.","Avoid sharing one daemon connection across concurrent installs.","Keep KernelResponse handling exhaustive with a default that logs the variant."],"tags":["unexpected-response","daemon","protocol","rpc"],"backgroundTag":"unexpected-response-shape","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}