From 09a264ebee43332fa22c19afa8a6323bdd1ba06e Mon Sep 17 00:00:00 2001 From: k9ight000 <121161284+k9ight000@users.noreply.github.com> Date: Tue, 4 Aug 2026 23:42:49 +0800 Subject: [PATCH 1/2] fix: keep repeated launcher on existing bridge --- apps/codex-plus-launcher/src/main.rs | 35 +++++++++++----------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/apps/codex-plus-launcher/src/main.rs b/apps/codex-plus-launcher/src/main.rs index af73c5067..93b6725c7 100644 --- a/apps/codex-plus-launcher/src/main.rs +++ b/apps/codex-plus-launcher/src/main.rs @@ -158,7 +158,6 @@ fn should_recover_stale_launcher(debug_port: u16) -> bool { async fn activate_existing_codex_app(options: &LaunchOptions) -> anyhow::Result<()> { let hooks = LauncherHooks::default(); - let helper_port = hooks.select_helper_port(options.helper_port); let settings = hooks.load_settings().await?; let app_dir = hooks.resolve_app_dir(options.app_dir.as_deref(), &settings)?; let launch_result = hooks @@ -169,9 +168,6 @@ async fn activate_existing_codex_app(options: &LaunchOptions) -> anyhow::Result< &settings.codex_extra_args, ) .await; - if settings.enhancements_enabled { - hooks.start_helper(helper_port).await?; - } let process_ids = codex_plus_core::watcher::find_codex_processes(); let mut activated = false; #[cfg(windows)] @@ -183,31 +179,14 @@ async fn activate_existing_codex_app(options: &LaunchOptions) -> anyhow::Result< } } } - let injection_ready = if settings.enhancements_enabled { - hooks - .ensure_injection(options.debug_port, helper_port, &app_dir) - .await - } else { - false - }; - if injection_ready { - hooks - .start_bridge_watchdog(options.debug_port, helper_port) - .await?; - hooks.write_status("running").await; - } else if settings.enhancements_enabled { - hooks.write_status("running_degraded").await; - } let _ = codex_plus_core::diagnostic_log::append_diagnostic_log( "launcher.activate_existing_codex", json!({ "app_dir": app_dir.to_string_lossy(), "debug_port": options.debug_port, - "helper_port": helper_port, "requested_helper_port": options.helper_port, "process_ids": process_ids, "activated": activated, - "injection_ready": injection_ready, "launch_ok": launch_result.is_ok(), "launch_error": launch_result.as_ref().err().map(|error| error.to_string()) }), @@ -864,6 +843,20 @@ mod tests { assert!(source.contains("launcher.already_running")); } + #[test] + fn repeated_launcher_does_not_recreate_the_bridge() { + let source = include_str!("main.rs"); + let existing_instance_path = source + .split_once("async fn activate_existing_codex_app") + .and_then(|(_, source)| source.split_once("fn log_launcher_already_running")) + .map(|(path, _)| path) + .expect("existing-instance launcher path should be present"); + + assert!(!existing_instance_path.contains("start_helper")); + assert!(!existing_instance_path.contains("ensure_injection")); + assert!(!existing_instance_path.contains("start_bridge_watchdog")); + } + #[test] fn launcher_hooks_forward_runtime_watchdogs_and_computer_use_guard_methods() { let source = include_str!("main.rs"); From ae36cd3a2bccd3452d96dabb8bfab0afd41e37e6 Mon Sep 17 00:00:00 2001 From: k9ight000 <121161284+k9ight000@users.noreply.github.com> Date: Thu, 13 Aug 2026 20:20:02 +0800 Subject: [PATCH 2/2] fix: preserve upstream asset line endings on Windows --- .gitattributes | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.gitattributes b/.gitattributes index 561487b9d..4ccd8b1bf 100644 --- a/.gitattributes +++ b/.gitattributes @@ -14,3 +14,14 @@ assets/inject/upstream/snow-skin/*.css text eol=lf # Keep byte-exact macOS theme assets identical on every checkout platform. assets/inject/upstream/*/macos/*.js text eol=lf assets/inject/upstream/*/macos/*.css text eol=lf + +# Keep byte-exact Windows theme assets identical on every checkout platform. +assets/inject/upstream/*/windows/*.js text eol=lf +assets/inject/upstream/*/windows/*.css text eol=lf + +# Keep byte-exact Glass Vision assets identical on every checkout platform. +assets/inject/upstream/glass-vision/*.js text eol=lf +assets/inject/upstream/glass-vision/*.css text eol=lf + +# Keep skin-pack theme files byte-exact on every checkout platform. +assets/inject/upstream/skin-packs/packs/*/theme.json text eol=lf