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

  1. Treat the warning as transient: re-run the build after restarting the cache agent so the prediction records cleanly
  2. Verify agent and wrapper mise versions match to stop the variant mismatch
  3. 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

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


AI-assisted analysis of jdx/mise@9dcfcaa0dc (2026-08-17). Data as JSON: /api/errors/04b8f9cda960cedf. Report an issue: GitHub.