{"record":{"id":"1faa958948f2ac2a","repo":"Hmbown/CodeWhale","slug":"the-cache-route-endpoint-changed-since-the-last-tu","errorCode":null,"errorMessage":"the cache route endpoint changed since the last turn; send a new turn before warming","messagePattern":"the cache route endpoint changed since the last turn; send a new turn before warming","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/tui/ui/provider_routes.rs","lineNumber":264,"sourceCode":"        .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            );\n        }\n    }\n    Ok(route)\n}\n\npub(crate) fn error_health_route(\n    app: &App,\n    fallback_provider: ApiProvider,\n) -> (ApiProvider, String) {\n    app.active_turn\n        .as_ref()\n        .and_then(|turn| turn.route.as_ref())\n        .map(|route| (route.provider, route.model.clone()))\n        .or_else(|| {\n            app.pending_turn_route\n                .as_ref()","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/tui/ui/provider_routes.rs#L246-L282","documentation":"Raised in resolve_cache_replay_route when the endpoint resolved for the saved cache route differs from the endpoint used in the last turn. Cache warming replays the conversation prefix, which is only valid against the same endpoint; an endpoint change (base URL or routing change) invalidates replay until a new turn re-establishes the route.","triggerScenarios":"Thrown at crates/tui/src/tui/ui/provider_routes.rs:264 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send a new turn to re-resolve the route at its current endpoint","Review provider/base-URL configuration changes that altered the endpoint","Revert the endpoint change if cache continuity against the original endpoint is required"],"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"}