{"record":{"id":"07e0b3a0a51b71ad","repo":"astrid-runtime/astrid","slug":"unexpected-response-from-kernel-other-07e0b3","errorCode":null,"errorMessage":"unexpected response from kernel: {other:?}","messagePattern":"unexpected response from kernel: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/group.rs","lineNumber":105,"sourceCode":"\n/// Top-level dispatcher for `astrid group`.\npub(crate) async fn run(cmd: GroupCommand) -> Result<ExitCode> {\n    match cmd {\n        GroupCommand::Create(args) => run_create(args).await,\n        GroupCommand::Show(args) => run_show(args).await,\n        GroupCommand::List(args) => run_list(args).await,\n        GroupCommand::Delete(args) => run_delete(args).await,\n        GroupCommand::Modify(args) => run_modify(args).await,\n    }\n}\n\nasync fn fetch_groups() -> Result<Vec<GroupSummary>> {\n    let mut client = crate::admin_client::connect_as_active_agent().await?;\n    let body = client.request(AdminRequestKind::GroupList).await?;\n    let body = into_result(body)?;\n    match body {\n        AdminResponseBody::GroupList(list) => Ok(list),\n        other => anyhow::bail!(\"unexpected response from kernel: {other:?}\"),\n    }\n}\n\nasync fn run_create(args: CreateArgs) -> Result<ExitCode> {\n    if args.caps.is_empty() {\n        eprintln!(\"astrid: --caps is required (use comma-separated values)\");\n        return Ok(ExitCode::from(1));\n    }\n    let mut client = crate::admin_client::connect_as_active_agent().await?;\n    let body = client\n        .request(AdminRequestKind::GroupCreate {\n            name: args.name.clone(),\n            capabilities: args.caps,\n            description: args.description,\n            unsafe_admin: args.unsafe_admin,\n        })\n        .await?;\n    let _ = into_result(body)?;","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/group.rs#L87-L123","documentation":"fetch_groups sends a GroupList admin request to the kernel and expects the response body to be AdminResponseBody::GroupList. Any other response variant is a protocol mismatch, so the CLI bails with a debug dump of the unexpected response instead of misinterpreting it.","triggerScenarios":"Calling `astrid group show` or `astrid group list` when the connected kernel replies to GroupList with a different AdminResponseBody variant — typically due to a CLI/kernel version skew or a routing bug in the admin protocol.","commonSituations":"Running a newer/older CLI against a mismatched kernel daemon; a proxy or misconfigured admin socket returning error bodies where typed responses are expected; kernel code changed a response shape without the CLI being updated.","solutions":["Check CLI and kernel versions match (`astrid --version` vs the daemon's version) and upgrade the mismatched component.","Restart the kernel daemon to rule out stale state.","Inspect the dumped `other` payload in the message to identify which variant was returned and report/update accordingly."],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"// Check version compatibility before issuing admin requests:\nlet cli_ver = env!(\"CARGO_PKG_VERSION\");\nlet kernel_ver = client.version().await?;\nif !versions_compatible(cli_ver, &kernel_ver) {\n    eprintln!(\"CLI {cli_ver} incompatible with kernel {kernel_ver}\");\n}","typeGuard":"fn as_group_list(body: &AdminResponseBody) -> Option<&Vec<GroupSummary>> {\n    match body {\n        AdminResponseBody::GroupList(l) => Some(l),\n        _ => None,\n    }\n}","tryCatchPattern":"match body {\n    AdminResponseBody::GroupList(list) => Ok(list),\n    other => {\n        tracing::error!(\"GroupList mismatch: {other:?}\");\n        anyhow::bail!(\"unexpected response from kernel: {other:?}\")\n    }\n}","preventionTips":["Pin CLI and kernel versions together in deployments.","On upgrade, update both components in the same change window.","Log full response bodies at debug level to ease protocol debugging."],"tags":["cli","kernel","ipc","protocol"],"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"}