{"record":{"id":"cb56c681c6b25e04","repo":"astrid-runtime/astrid","slug":"daemon-rejected-status-request-message-cb56c6","errorCode":null,"errorMessage":"daemon rejected status request: {message}","messagePattern":"daemon rejected status request: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/doctor.rs","lineNumber":242,"sourceCode":"}\n\nasync fn daemon_roundtrip() -> Result<()> {\n    let mut client = tokio::time::timeout(\n        Duration::from_secs(5),\n        crate::socket_client::connect_kernel_for_workspace(None),\n    )\n    .await\n    .map_err(|_| anyhow::anyhow!(\"connection timed out after 5s\"))??;\n    match tokio::time::timeout(\n        Duration::from_secs(5),\n        client.request(KernelRequest::GetStatus),\n    )\n    .await\n    .map_err(|_| anyhow::anyhow!(\"daemon response timed out after 5s\"))??\n    {\n        KernelResponse::Status(_) => Ok(()),\n        KernelResponse::Error(message) => {\n            Err(anyhow::anyhow!(\"daemon rejected status request: {message}\"))\n        },\n        _ => Err(anyhow::anyhow!(\n            \"daemon returned an unexpected status response\"\n        )),\n    }\n}\n\n/// Query the daemon for agent-loop readiness over the same socket the\n/// other daemon-dependent checks use. Rides the existing\n/// `astrid.v1.request.` ingress allowlist prefix — no capsule change needed.\nasync fn agent_readiness() -> Result<astrid_core::kernel_api::AgentLoopReadiness> {\n    let mut client = tokio::time::timeout(\n        Duration::from_secs(5),\n        crate::socket_client::connect_kernel_for_workspace(None),\n    )\n    .await\n    .map_err(|_| anyhow::anyhow!(\"connection timed out after 5s\"))??;\n    match tokio::time::timeout(","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/doctor.rs#L224-L260","documentation":"doctor's daemon_roundtrip received a timely KernelResponse::Error for its GetStatus request. The IPC round-trip worked; the daemon itself refused/failed the status request and this error surfaces the daemon's own message verbatim.","triggerScenarios":"daemon_roundtrip matches KernelResponse::Error(message): the kernel rejected GetStatus, e.g. workspace not initialized/registered in the daemon, kernel in a failed state after a crash, version/protocol mismatch between CLI and daemon, or internal kernel error handling the status query.","commonSituations":"Running doctor from a directory the daemon doesn't track; daemon started under an older/newer astrid version with protocol drift; kernel recovered into a degraded state needing restart.","solutions":["Read the daemon's message embedded in the error — it names the specific rejection reason.","Restart the daemon so it re-registers the workspace, then re-run doctor.","Ensure CLI and daemon are the same astrid version (upgrade both) to rule out protocol mismatch.","Run doctor from the correct workspace directory."],"exampleFix":"// before\n$ astrid doctor\nError: daemon rejected status request: workspace not registered\n// after\n$ astrid daemon restart && astrid doctor  # daemon roundtrip: ok","handlingStrategy":"try-catch","validationCode":"// Check the daemon is tracking this workspace before requesting status\nif !daemon_workspace_registered(&workspace_path).await? {\n    eprintln!(\"workspace not registered with daemon\");\n}","typeGuard":"// Narrow the response before acting\nif let KernelResponse::Error(msg) = resp { return Err(anyhow!(\"daemon: {msg}\")); }","tryCatchPattern":"match client.request(KernelRequest::GetStatus).await {\n    Ok(KernelResponse::Status(_)) => Ok(()),\n    Ok(KernelResponse::Error(m)) => Err(anyhow!(\"daemon rejected status: {m}\")),\n    Ok(_) => Err(anyhow!(\"unexpected response\")),\n    Err(e) => Err(e.into()),\n}","preventionTips":["Run CLI and daemon from the same astrid version.","Register the workspace with the daemon before querying status.","Surface the daemon's error message to the user instead of masking it.","Restart the daemon after kernel crashes to clear degraded state."],"tags":["ipc","daemon","protocol","status"],"backgroundTag":"api-error-response","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"}