jdx/mise · error · eyre::Report
cache agent returned an incompatible rustc action prediction
Error message
cache agent returned an incompatible rustc action prediction
What it means
A returned action prediction must carry adapter == "rustc" and the same invocation digest the wrapper sent. If either differs, the prediction belongs to another adapter or another compiler invocation, so applying it would poison the cache and the wrapper bails with 'incompatible rustc action prediction' (src/cache/rustc.rs:145).
Source
Thrown at src/cache/rustc.rs:145
let mut context = base_action_context(rustc, working_dir)?;
let invocation_digest = invocation.invocation_digest(&context)?;
let responses = session::request_agent(&[AgentRequest::FindActionPrediction {
task,
invocation: invocation_digest.clone(),
}])?;
let Some(response) = responses.into_iter().next() else {
bail!("cache agent did not return an action prediction response");
};
let prediction = match response {
AgentResponse::ActionPrediction {
prediction: Some(prediction),
} => prediction,
AgentResponse::ActionPrediction { prediction: None } => return Ok(None),
AgentResponse::Error { message } => bail!(message),
_ => bail!("cache agent returned an unexpected action prediction response"),
};
if prediction.adapter != "rustc" || prediction.invocation != invocation_digest {
bail!("cache agent returned an incompatible rustc action prediction");
}
let input_prediction: RustcInputPrediction = serde_json::from_str(&prediction.payload)?;
if String::from_utf8(canonical_json(&input_prediction)?)? != prediction.payload {
bail!("cache agent returned a non-canonical rustc action prediction");
}
let discovered = input_prediction.discover(working_dir, &context.path_mappings)?;
discovered.clone().apply_to(&mut context)?;
let action = invocation.action(context)?;
let restored = restore_result(&action, outputs, &discovered, restore_outputs)?;
if restored.is_some() {
record_prediction_value(invocation_digest, action.digest.clone(), prediction.payload);
}
Ok(restored)
}
fn action_from_dep_info(
rustc: &OsStr,
invocation: &RustcInvocation,View on GitHub (pinned to 9dcfcaa0dc)
Solutions
- Restart the cache agent and rebuild so fresh, self-consistent predictions are recorded
- Clear the agent's cache store so stale/mislabeled predictions are dropped
- Align on one mise version across the agent and all build shells; if it recurs, disable the rustc cache and report it
Defensive patterns
Strategy: retry
Try / catch
# Rust (if invoking the wrapper): fall back to plain rustc on protocol errors
match cache_lookup() {
Err(e) if e.to_string().contains("incompatible rustc action prediction") => {
run_plain_rustc()?; // bypass cache, recompile
}
r => r?,
} Prevention
- Clear the agent's prediction store after mise upgrades
- Never share one cache agent across different adapters/versions
- Rebuild once after any toolchain/mise change to re-record
When it happens
Trigger: The agent serves a prediction recorded under a different invocation digest (digest computation changed between mise versions) or tagged for a different adapter; e.g. after upgrading mise while the agent kept pre-upgrade entries.
Common situations: mise upgrade changing the invocation-digest recipe; an agent shared by several wrapper types returning a wrong-adapter record; corrupted agent-side index mapping digests to predictions.
Related errors
- cache agent did not return an action prediction response
- cache agent returned an unexpected action prediction respons
- cache agent returned an unexpected prediction response
- 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/b61dccd3161f00fa.
Report an issue: GitHub.