{"record":{"id":"ae096bed3013f529","repo":"Hmbown/CodeWhale","slug":"auto-has-no-concrete-route-yet-send-a-turn-before","errorCode":null,"errorMessage":"Auto has no concrete route yet; send a turn before warming its cache","messagePattern":"Auto has no concrete route yet; send a turn before warming its cache","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"warning","filePath":"crates/tui/src/tui/ui/provider_routes.rs","lineNumber":239,"sourceCode":"}\n\npub(crate) async fn fetch_available_models(config: &Config) -> Result<Vec<String>> {\n    use crate::client::DeepSeekClient;\n\n    let client = DeepSeekClient::new(config)?;\n    let models = tokio::time::timeout(Duration::from_secs(20), client.list_models()).await??;\n    let mut ids = models.into_iter().map(|model| model.id).collect::<Vec<_>>();\n    ids.sort();\n    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))","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/tui/ui/provider_routes.rs#L221-L257","documentation":"Cache warming replays the concrete provider/model route behind the 'Auto' selector. That route (last_effective_provider / last_effective_model) exists only after a completed turn; on a fresh conversation, or one restored without endpoint truth, cache_replay_target() returns None and resolve_cache_replay_route bails with this guidance message. A sibling bail covers a saved identity that now resolves to a different provider/key.","triggerScenarios":"Invoking the cache-warm action while the model selector is Auto and no turn has completed: right after launch, after /new, or in a restored session that retained provider/model but no endpoint.","commonSituations":"Users pressing warm-cache first thing in a session; restored Auto sessions whose endpoint was not captured.","solutions":["Send one message/turn so Auto resolves a concrete provider and model, then warm the cache","If it still fails after a turn, check that provider/key config has not drifted from the saved route identity (the sibling error names the mismatch)","Switch from Auto to an explicit provider/model so the active route is authoritative immediately"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Rust - only offer cache warming once a concrete route exists\nif app.cache_replay_target().is_none() {\n    disable_warm_cache_action(); // Auto has no concrete route yet\n    return;\n}","typeGuard":null,"tryCatchPattern":"let target = app.cache_replay_target()\n    .ok_or_else(|| anyhow::anyhow!(\"Auto has no concrete route yet; send a turn before warming its cache\"))?;\n// resolve identity and warm; surface the guidance message verbatim to the user","preventionTips":["Send at least one turn on Auto before warming its cache","Gate the warm action on cache_replay_target() being Some","After provider/key config changes, complete a new turn so the route identity refreshes"],"tags":["provider-route","auto-model","cache","warmup"],"backgroundTag":"provider-route-unresolved","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}