{"record":{"id":"58cdc3d485b8707e","repo":"jdx/mise","slug":"cache-agent-returned-a-non-canonical-rustc-action","errorCode":null,"errorMessage":"cache agent returned a non-canonical rustc action prediction","messagePattern":"cache agent returned a non-canonical rustc action prediction","errorType":"console","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/cache/rustc.rs","lineNumber":149,"sourceCode":"        invocation: invocation_digest.clone(),\n    }])?;\n    let Some(response) = responses.into_iter().next() else {\n        bail!(\"cache agent did not return an action prediction response\");\n    };\n    let prediction = match response {\n        AgentResponse::ActionPrediction {\n            prediction: Some(prediction),\n        } => prediction,\n        AgentResponse::ActionPrediction { prediction: None } => return Ok(None),\n        AgentResponse::Error { message } => bail!(message),\n        _ => bail!(\"cache agent returned an unexpected action prediction response\"),\n    };\n    if prediction.adapter != \"rustc\" || prediction.invocation != invocation_digest {\n        bail!(\"cache agent returned an incompatible rustc action prediction\");\n    }\n    let input_prediction: RustcInputPrediction = serde_json::from_str(&prediction.payload)?;\n    if String::from_utf8(canonical_json(&input_prediction)?)? != prediction.payload {\n        bail!(\"cache agent returned a non-canonical rustc action prediction\");\n    }\n    let discovered = input_prediction.discover(working_dir, &context.path_mappings)?;\n    discovered.clone().apply_to(&mut context)?;\n    let action = invocation.action(context)?;\n    let restored = restore_result(&action, outputs, &discovered, restore_outputs)?;\n    if restored.is_some() {\n        record_prediction_value(invocation_digest, action.digest.clone(), prediction.payload);\n    }\n    Ok(restored)\n}\n\nfn action_from_dep_info(\n    rustc: &OsStr,\n    invocation: &RustcInvocation,\n    dep_info: &Path,\n    working_dir: &Path,\n) -> Result<(RustcAction, DiscoveredInputs)> {\n    let dep_info = RustcDepInfo::read(dep_info)?;","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/cache/rustc.rs#L131-L167","documentation":"Error \"cache agent returned a non-canonical rustc action prediction\" thrown in jdx/mise.","triggerScenarios":"Thrown at src/cache/rustc.rs:149 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Clear the cached prediction for this action and retry; the cached JSON was not canonical.","Restart the cache agent and rebuild."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}