Require models refresh on cli version mismatch (#10414)

This commit is contained in:
Ahmed Ibrahim
2026-02-02 18:55:25 -08:00
committed by GitHub
parent fc05374344
commit b8addcddb9
5 changed files with 279 additions and 17 deletions

View File

@@ -75,9 +75,11 @@ pub fn write_models_cache_with_models(
let cache_path = codex_home.join("models_cache.json");
// DateTime<Utc> serializes to RFC3339 format by default with serde
let fetched_at: DateTime<Utc> = Utc::now();
let client_version = codex_core::models_manager::client_version_to_whole();
let cache = json!({
"fetched_at": fetched_at,
"etag": null,
"client_version": client_version,
"models": models
});
std::fs::write(cache_path, serde_json::to_string_pretty(&cache)?)