jdx/mise · warning · eyre::Report
cache agent returned an unexpected prediction response
Error message
cache agent returned an unexpected prediction response
What it means
After sending RecordActionPrediction, the wrapper expects exactly AgentResponse::ActionPredictionRecorded (or Error). Any other variant is a protocol violation; unlike the other cache errors it is caught and only printed as 'mise rustc cache warning: action prediction was not recorded: ...' — the build continues, the entry just is not cached (src/cache/rustc.rs:241).
Source
Thrown at src/cache/rustc.rs:241
}
fn record_prediction_value(invocation: CacheDigest, action: CacheDigest, payload: String) {
let result = (|| {
let task = std::env::var(session::TASK_ENV)
.wrap_err_with(|| format!("{} is not set", session::TASK_ENV))?;
let responses = session::request_agent(&[AgentRequest::RecordActionPrediction {
task,
prediction: ActionPrediction {
invocation,
action,
adapter: "rustc".into(),
payload,
},
}])?;
match responses.into_iter().next() {
Some(AgentResponse::ActionPredictionRecorded) => Ok(()),
Some(AgentResponse::Error { message }) => bail!(message),
_ => bail!("cache agent returned an unexpected prediction response"),
}
})();
if let Err(error) = result {
eprintln!("mise rustc cache warning: action prediction was not recorded: {error:#}");
}
}
fn verify_environment(environment: &BTreeMap<String, Option<String>>) -> Result<()> {
for (name, expected) in environment {
let actual = std::env::var_os(name)
.map(|value| {
value.into_string().map_err(|_| {
eyre::eyre!("compiler environment input is not valid UTF-8: {name}")
})
})
.transpose()?;
if &actual != expected {
bail!("compiler environment input changed: {name}");View on GitHub (pinned to 9dcfcaa0dc)
Solutions
- Treat the warning as transient: re-run the build after restarting the cache agent so the prediction records cleanly
- Verify agent and wrapper mise versions match to stop the variant mismatch
- If warnings persist, disable the rustc cache wrapper for that environment
Defensive patterns
Strategy: fallback
Try / catch
# Already non-fatal: log-scrape to detect cache loss # e.g. CI step: # grep -c 'action prediction was not recorded' build.log > cache_warnings.txt # alert when it grows on every run
Prevention
- Check build logs for rustc cache warnings — repeated ones mean version skew
- Restart agents after upgrades so records succeed again
- Treat chronic warnings as loss of caching, not a build failure
When it happens
Trigger: The agent replies with an unexpected variant to a record request — agent crash/restart between request and reply, or version skew in the response enum.
Common situations: Same family as the other protocol errors: mixed mise versions, agent dying under concurrent load. Harmless for correctness (compile still happens) but silently loses caching.
Related errors
- cache agent did not return an action prediction response
- cache agent returned an unexpected action prediction respons
- cache agent returned an incompatible rustc action prediction
- cache agent did not return an action lookup response
- cache agent returned an unexpected action lookup response
AI-assisted analysis of jdx/mise@9dcfcaa0dc (2026-08-17).
Data as JSON: /api/errors/04b8f9cda960cedf.
Report an issue: GitHub.