From a37adea0db55681b873443b340fb68c4f88b3b77 Mon Sep 17 00:00:00 2001 From: Vaibhav Srivastav Date: Mon, 27 Apr 2026 13:07:12 +0100 Subject: [PATCH] Promote Codex App on Windows in tooltips --- README.md | 2 +- codex-rs/tui/src/tooltips.rs | 51 ++++++++++++++++++++++++++++++------ codex-rs/tui/tooltips.txt | 2 +- 3 files changed, 45 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 5cc7fd4953..0e969a2c94 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@


If you want Codex in your code editor (VS Code, Cursor, Windsurf), install in your IDE. -
If you want the desktop app experience, run codex app or visit the Codex App page. +
If you want the desktop app experience on macOS or Windows, run codex app or visit the Codex App page.
If you are looking for the cloud-based agent from OpenAI, Codex Web, go to chatgpt.com/codex.

--- diff --git a/codex-rs/tui/src/tooltips.rs b/codex-rs/tui/src/tooltips.rs index 8eb156156e..d047d1fa22 100644 --- a/codex-rs/tui/src/tooltips.rs +++ b/codex-rs/tui/src/tooltips.rs @@ -6,13 +6,12 @@ use rand::Rng; const ANNOUNCEMENT_TIP_URL: &str = "https://raw.githubusercontent.com/openai/codex/main/announcement_tip.toml"; -const IS_MACOS: bool = cfg!(target_os = "macos"); -const IS_WINDOWS: bool = cfg!(target_os = "windows"); +const SUPPORTS_DESKTOP_APP: bool = cfg!(any(target_os = "macos", target_os = "windows")); -const APP_TOOLTIP: &str = "Try the **Codex App**. Run 'codex app' or visit https://chatgpt.com/codex?app-landing-page=true"; +const APP_TOOLTIP: &str = "Try the **Codex App** on Windows and macOS. Run 'codex app' or visit https://chatgpt.com/codex?app-landing-page=true"; const FAST_TOOLTIP: &str = "*New* Use **/fast** to enable our fastest inference with increased plan usage."; -const OTHER_TOOLTIP: &str = "*New* Build faster with the **Codex App**. Run 'codex app' or visit https://chatgpt.com/codex?app-landing-page=true"; +const OTHER_TOOLTIP: &str = "*New* Build faster with the **Codex App** on Windows and macOS. Run 'codex app' or visit https://chatgpt.com/codex?app-landing-page=true"; const OTHER_TOOLTIP_NON_MAC: &str = "*New* Build faster with Codex."; const FREE_GO_TOOLTIP: &str = "*New* For a limited time, Codex is included in your plan for free – let’s build together."; @@ -27,7 +26,7 @@ lazy_static! { if line.is_empty() || line.starts_with('#') { return false; } - if !IS_MACOS && !IS_WINDOWS && line.contains("codex app") { + if !SUPPORTS_DESKTOP_APP && line.contains("codex app") { return false; } true @@ -71,10 +70,10 @@ pub(crate) fn get_tooltip(plan: Option, fast_mode_enabled: bool) -> Op } } Some(PlanType::Go) | Some(PlanType::Free) => { - return Some(FREE_GO_TOOLTIP.to_string()); + return Some(pick_free_go_tooltip(&mut rng, SUPPORTS_DESKTOP_APP).to_string()); } _ => { - let tooltip = if IS_MACOS { + let tooltip = if SUPPORTS_DESKTOP_APP { OTHER_TOOLTIP } else { OTHER_TOOLTIP_NON_MAC @@ -88,7 +87,7 @@ pub(crate) fn get_tooltip(plan: Option, fast_mode_enabled: bool) -> Op } fn paid_app_tooltip() -> Option<&'static str> { - if IS_MACOS || IS_WINDOWS { + if SUPPORTS_DESKTOP_APP { Some(APP_TOOLTIP) } else { None @@ -110,6 +109,14 @@ fn pick_paid_tooltip( } } +fn pick_free_go_tooltip(rng: &mut R, supports_desktop_app: bool) -> &'static str { + if supports_desktop_app && rng.random_bool(0.5) { + APP_TOOLTIP + } else { + FREE_GO_TOOLTIP + } +} + fn pick_tooltip(rng: &mut R) -> Option<&'static str> { if ALL_TOOLTIPS.is_empty() { None @@ -373,6 +380,34 @@ mod tests { assert!(!seen.contains(&Some(FAST_TOOLTIP))); } + #[test] + fn free_go_tooltip_rotates_between_plan_and_desktop_promos() { + let mut seen = std::collections::BTreeSet::new(); + for seed in 0..16 { + let mut rng = StdRng::seed_from_u64(seed); + seen.insert(pick_free_go_tooltip( + &mut rng, /*supports_desktop_app*/ true, + )); + } + + let expected = std::collections::BTreeSet::from([APP_TOOLTIP, FREE_GO_TOOLTIP]); + assert_eq!(seen, expected); + } + + #[test] + fn free_go_tooltip_skips_desktop_promo_on_other_platforms() { + let mut seen = std::collections::BTreeSet::new(); + for seed in 0..16 { + let mut rng = StdRng::seed_from_u64(seed); + seen.insert(pick_free_go_tooltip( + &mut rng, /*supports_desktop_app*/ false, + )); + } + + let expected = std::collections::BTreeSet::from([FREE_GO_TOOLTIP]); + assert_eq!(seen, expected); + } + #[test] fn announcement_tip_toml_picks_last_matching() { let toml = r#" diff --git a/codex-rs/tui/tooltips.txt b/codex-rs/tui/tooltips.txt index 7ddaa94500..3a002e3bbe 100644 --- a/codex-rs/tui/tooltips.txt +++ b/codex-rs/tui/tooltips.txt @@ -11,7 +11,7 @@ Use /fork to branch the current chat into a new thread. Use /side to start a side conversation in a temporary fork without polluting the main thread. Use /init to create an AGENTS.md with project-specific guidance. Use /mcp to list configured MCP tools. -Run `codex app` to open Codex Desktop (it installs on macOS if needed). +Run `codex app` to open the Codex App or get the macOS or Windows installer. Use /personality to customize how Codex communicates. Use /rename to rename your threads for easier thread resuming. Use the OpenAI docs MCP for API questions; enable it with `codex mcp add openaiDeveloperDocs --url https://developers.openai.com/mcp`.