{"record":{"id":"04b8f9cda960cedf","repo":"jdx/mise","slug":"cache-agent-returned-an-unexpected-prediction-resp","errorCode":null,"errorMessage":"cache agent returned an unexpected prediction response","messagePattern":"cache agent returned an unexpected prediction response","errorType":"console","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/cache/rustc.rs","lineNumber":248,"sourceCode":"}\n\nfn record_prediction_value(invocation: CacheDigest, action: CacheDigest, payload: String) {\n    let result = (|| {\n        let task = std::env::var(session::TASK_ENV)\n            .wrap_err_with(|| format!(\"{} is not set\", session::TASK_ENV))?;\n        let responses = session::request_agent(&[AgentRequest::RecordActionPrediction {\n            task,\n            prediction: ActionPrediction {\n                invocation,\n                action,\n                adapter: \"rustc\".into(),\n                payload,\n            },\n        }])?;\n        match responses.into_iter().next() {\n            Some(AgentResponse::ActionPredictionRecorded) => Ok(()),\n            Some(AgentResponse::Error { message }) => bail!(message),\n            _ => bail!(\"cache agent returned an unexpected prediction response\"),\n        }\n    })();\n    if let Err(error) = result {\n        eprintln!(\"mise rustc cache warning: action prediction was not recorded: {error:#}\");\n    }\n}\n\nfn verify_environment(environment: &BTreeMap<String, Option<String>>) -> Result<()> {\n    for (name, expected) in environment {\n        let actual = std::env::var_os(name)\n            .map(|value| {\n                value.into_string().map_err(|_| {\n                    eyre::eyre!(\"compiler environment input is not valid UTF-8: {name}\")\n                })\n            })\n            .transpose()?;\n        if &actual != expected {\n            bail!(\"compiler environment input changed: {name}\");","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/cache/rustc.rs#L230-L266","documentation":"Error \"cache agent returned an unexpected prediction response\" thrown in jdx/mise.","triggerScenarios":"Thrown at src/cache/rustc.rs:248 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Restart the cache agent; it answered with the wrong response type.","Check agent logs and protocol version compatibility."],"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"}