{"record":{"id":"6393016466d1cae9","repo":"Hmbown/CodeWhale","slug":"saved-cache-route-identity-now-resolves-as","errorCode":null,"errorMessage":"saved cache route identity `{}` now resolves as {}/{} instead of {}/{}; send a new turn before warming","messagePattern":"saved cache route identity `(.+?)` now resolves as (.+?)/(.+?) instead of (.+?)/(.+?); send a new turn before warming","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/tui/ui/provider_routes.rs","lineNumber":248,"sourceCode":"    ids.dedup();\n    Ok(ids)\n}\n\npub(crate) fn resolve_cache_replay_route(\n    app: &App,\n    config: &Config,\n) -> Result<crate::route_runtime::ResolvedRuntimeRoute> {\n    let target = app.cache_replay_target().ok_or_else(|| {\n        anyhow::anyhow!(\"Auto has no concrete route yet; send a turn before warming its cache\")\n    })?;\n    let identity = config\n        .resolve_persisted_provider_identity(\n            Some(target.provider.as_str()),\n            target.provider_id.as_deref(),\n        )\n        .map_err(anyhow::Error::msg)?;\n    if identity.provider != target.provider || identity.key != target.provider_identity {\n        anyhow::bail!(\n            \"saved cache route identity `{}` now resolves as {}/{} instead of {}/{}; send a new turn before warming\",\n            target.provider_identity,\n            identity.provider.as_str(),\n            identity.key,\n            target.provider.as_str(),\n            target.provider_identity\n        );\n    }\n    let route = resolve_runtime_route_for_identity(config, &identity, Some(&target.model))\n        .map_err(anyhow::Error::msg)?;\n    if let Some(previous_base_url) = target.base_url.as_deref() {\n        let previous_endpoint = crate::route_receipt::endpoint_identity(previous_base_url);\n        let current_endpoint =\n            crate::route_receipt::endpoint_identity(&route.candidate.endpoint().base_url);\n        if previous_endpoint != current_endpoint {\n            anyhow::bail!(\n                \"the cache route endpoint changed since the last turn; send a new turn before warming\"\n            );","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/tui/ui/provider_routes.rs#L230-L266","documentation":"Raised in resolve_cache_replay_route when the persisted cache route identity (provider/key) re-resolves differently than the identity recorded for the last turn's target. The saved route would warm a cache for a different provider or account than the one the conversation prefix was built on, which would corrupt cache semantics, so the user is told to establish the new route with a fresh turn.","triggerScenarios":"Thrown at crates/tui/src/tui/ui/provider_routes.rs:248 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send a new turn so the cache replay target re-binds to the currently resolved identity","Check whether provider config, credentials, or a profile changed the resolved provider/key","Restore the previous provider configuration if the old identity was intended"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}