Lightweight coding agent that runs in your terminal
Rust
Allow enterprises to skip upgrade checks and messages (#7213)
Gabriel Peal3741f387e94c
diff --git a/codex-rs/core/src/config/mod.rs b/codex-rs/core/src/config/mod.rsindex 3d5f25763c..b15465653d 100644--- a/codex-rs/core/src/config/mod.rs+++ b/codex-rs/core/src/config/mod.rs@@ -267,6 +267,11 @@ pub struct Config {/// Collection of various notices we show the userpub notices: Notice,+ /// When `true`, checks for Codex updates on startup and surfaces update prompts.+ /// Set to `false` only if your Codex updates are centrally managed.+ /// Defaults to `true`.+ pub check_for_update_on_startup: bool,+/// When true, disables burst-paste detection for typed input entirely./// All characters are inserted as they are received, and no buffering/// or placeholder replacement will occur for fast keypress bursts.@@ -685,6 +690,11 @@ pub struct ConfigToml {#[serde(default)]pub features: Option<FeaturesToml>,+ /// When `true`, checks for Codex updates on startup and surfaces update prompts.+ /// Set to `false` only if your Codex updates are centrally managed.+ /// Defaults to `true`.+ pub check_for_update_on_startup: Option<bool>,+/// When true, disables burst-paste detection for typed input entirely./// All characters are inserted as they are received, and no buffering/// or placeholder replacement will occur for fast keypress bursts.@@ -1162,6 +1172,8 @@ impl Config {.or(cfg.review_model).unwrap_or_else(default_review_model);+ let check_for_update_on_startup = cfg.check_for_update_on_startup.unwrap_or(true);+let config = Self {model,review_model,@@ -1238,6 +1250,7 @@ impl Config {active_project,windows_wsl_setup_acknowledged: cfg.windows_wsl_setup_acknowledged.unwrap_or(false),notices: cfg.notice.unwrap_or_default(),+ check_for_update_on_startup,disable_paste_burst: cfg.disable_paste_burst.unwrap_or(false),tui_notifications: cfg.tui@@ -2992,6 +3005,7 @@ model_verbosity = "high"active_project: ProjectConfig { trust_level: None },windows_wsl_setup_acknowledged: false,notices: Default::default(),+ check_for_update_on_startup: true,disable_paste_burst: false,tui_notifications: Default::default(),animations: true,@@ -3064,6 +3078,7 @@ model_verbosity = "high"active_project: ProjectConfig { trust_level: None },windows_wsl_setup_acknowledged: false,notices: Default::default(),+ check_for_update_on_startup: true,disable_paste_burst: false,tui_notifications: Default::default(),animations: true,@@ -3151,6 +3166,7 @@ model_verbosity = "high"active_project: ProjectConfig { trust_level: None },windows_wsl_setup_acknowledged: false,notices: Default::default(),+ check_for_update_on_startup: true,disable_paste_burst: false,tui_notifications: Default::default(),animations: true,@@ -3224,6 +3240,7 @@ model_verbosity = "high"active_project: ProjectConfig { trust_level: None },windows_wsl_setup_acknowledged: false,notices: Default::default(),+ check_for_update_on_startup: true,disable_paste_burst: false,tui_notifications: Default::default(),animations: true,diff --git a/codex-rs/tui/src/updates.rs b/codex-rs/tui/src/updates.rsindex 0c3f2044ef..89fd6f32f6 100644--- a/codex-rs/tui/src/updates.rs+++ b/codex-rs/tui/src/updates.rs@@ -15,6 +15,10 @@ use std::path::PathBuf;use crate::version::CODEX_CLI_VERSION;pub fn get_upgrade_version(config: &Config) -> Option<String> {+ if !config.check_for_update_on_startup {+ return None;+ }+let version_file = version_filepath(config);let info = read_version_info(&version_file).ok();@@ -141,6 +145,10 @@ fn extract_version_from_latest_tag(latest_tag_name: &str) -> anyhow::Result<Stri/// Returns the latest version to show in a popup, if it should be shown./// This respects the user's dismissal choice for the current latest version.pub fn get_upgrade_version_for_popup(config: &Config) -> Option<String> {+ if !config.check_for_update_on_startup {+ return None;+ }+let version_file = version_filepath(config);let latest = get_upgrade_version(config)?;// If the user dismissed this exact version previously, do not show the popup.diff --git a/docs/config.md b/docs/config.mdindex 5051f27069..df4da3b005 100644--- a/docs/config.md+++ b/docs/config.md@@ -977,6 +977,7 @@ Valid values:| `tui` | table | TUI‑specific options. || `tui.notifications` | boolean \| array<string> | Enable desktop notifications in the tui (default: true). || `hide_agent_reasoning` | boolean | Hide model reasoning events. |+| `check_for_update_on_startup` | boolean | Check for Codex updates on startup (default: true). Set to `false` only if updates are centrally managed. || `show_raw_agent_reasoning` | boolean | Show raw reasoning (when available). || `model_reasoning_effort` | `minimal` \| `low` \| `medium` \| `high` | Responses API reasoning effort. || `model_reasoning_summary` | `auto` \| `concise` \| `detailed` \| `none` | Reasoning summaries. |