mirror of
https://github.com/openai/codex.git
synced 2026-11-21 15:10:25 +00:00
Warn when the connected Codex service is older than the CLI (#43622)
## What changed Show an older-service notice at startup and reconnect when both versions are official stable releases. Display it in conversation history or the agents overview, with wrapping and a compact fallback for small terminals. For the implicit local daemon, suggest `codex app-server daemon update` and warn that updating may interrupt active or queued work. Suppress repeated notices for the same service and version pair, and defer fresh-session notices until session attachment. ## Testing Add coverage for version notice eligibility, local-only update guidance, service identity, startup ordering, reconnect deduplication, and overview rendering at narrow and short sizes. GitOrigin-RevId: e0a5b306e0a4d405544c5f6eaa72f77df6d68e6d
This commit is contained in:
1 parent
4b0f44d304
commit
530383e36d
25 files changed
+605
-19
No files matched your search
@@ -1,3 +1,4 @@
|
||||
#[cfg(any(not(debug_assertions), test))]
|
||||
pub(crate) fn is_newer(latest: &str, current: &str) -> Option<bool> {
|
||||
match (parse_version(latest), parse_version(current)) {
|
||||
(Some(l), Some(c)) => Some(l > c),
|
||||
@@ -5,6 +6,7 @@ pub(crate) fn is_newer(latest: &str, current: &str) -> Option<bool> {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(not(debug_assertions), test))]
|
||||
pub(crate) fn extract_version_from_latest_tag(latest_tag_name: &str) -> anyhow::Result<String> {
|
||||
latest_tag_name
|
||||
.strip_prefix("rust-v")
|
||||
@@ -12,6 +14,7 @@ pub(crate) fn extract_version_from_latest_tag(latest_tag_name: &str) -> anyhow::
|
||||
.ok_or_else(|| anyhow::anyhow!("Failed to parse latest tag name '{latest_tag_name}'"))
|
||||
}
|
||||
|
||||
#[cfg(any(not(debug_assertions), test))]
|
||||
pub(crate) fn is_source_build_version(version: &str) -> bool {
|
||||
parse_version(version) == Some((0, 0, 0))
|
||||
}
|
||||
@@ -42,6 +45,7 @@ pub(crate) fn is_official_server_older(client: &str, server: &str) -> bool {
|
||||
matches!((stable_version(client), stable_version(server)), (Some(client), Some(server)) if client > server)
|
||||
}
|
||||
|
||||
#[cfg(any(not(debug_assertions), test))]
|
||||
fn parse_version(v: &str) -> Option<(u64, u64, u64)> {
|
||||
let mut iter = v.trim().split('.');
|
||||
let maj = iter.next()?.parse::<u64>().ok()?;
|
||||
|
||||
Reference in new issue
Block a user