mirror of
https://github.com/openai/codex.git
synced 2026-05-01 11:52:10 +03:00
Require models refresh on cli version mismatch (#10414)
This commit is contained in:
@@ -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)?)
|
||||
|
||||
Reference in New Issue
Block a user