Add opt-in direct Windows launch mode for elevated Codex sessions#350
Open
daaimengermengzhu wants to merge 2 commits into
Open
Add opt-in direct Windows launch mode for elevated Codex sessions#350daaimengermengzhu wants to merge 2 commits into
daaimengermengzhu wants to merge 2 commits into
Conversation
…dex-launch # Conflicts: # apps/codex-plus-manager/src/App.tsx # crates/codex-plus-core/src/settings.rs
Author
|
Merged the latest upstream \main\ into this branch and resolved conflicts in \�pps/codex-plus-manager/src/App.tsx\ and \crates/codex-plus-core/src/settings.rs\ by preserving both the new upstream goal/context settings and this PR's \windowsCodexLaunchMode\ setting.\n\nPost-merge local checks:\n- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
windowsCodexLaunchModesetting with the existing packaged activation path as the default.directProcessmode that skipsIApplicationActivationManager::ActivateApplicationfor WindowsApps Codex packages.directProcessis enabled for a packaged Codex install, stop existing Codex processes before launchingapp\Codex.exedirectly so Electron single-instance handoff does not reuse a non-elevated process.Motivation
Codex++ already embeds a
requireAdministratorWindows manifest, but the current WindowsApps launch path uses packaged app activation. In practice, that can create the official Codex process through the Windows app model rather than as a child of the elevated Codex++ launcher. The result is thatcodex-plus-plus.exeis elevated, while the actualCodex.exe,codex.exe app-server, and worker processes are not.This opt-in mode lets users who need elevated Codex sessions launch the official
app\Codex.exedirectly from the elevated Codex++ process.Compatibility
The default remains
packagedActivation, so existing users keep the current behavior unless they explicitly enable the new Windows direct launch option.Verification
npm run checkinapps/codex-plus-managernpm run vite:buildinapps/codex-plus-managerrustfmt --edition 2024 --checkon touched Rust filescargo test -p codex-plus-core direct_windowscargo test -p codex-plus-core settings_deserialize_reads_windows_codex_launch_modecargo test -p codex-plus-core launcher_uses_packaged_activation_by_default_for_windows_packagescargo clippy -p codex-plus-core --all-targets --all-featurescargo build --releasegit diff --checkNotes:
cargo clippy -p codex-plus-core --all-targets --all-features -- -D warningsreports existing warnings outside the changed code, so the PR does not include unrelated clippy cleanup.cargo test --all-features --jobs 1was attempted on Windows with Gitsh.exeadded toPATH; suites relevant to this change passed, but one existingupstream_worktreetest failed in this local environment.cargo fmt --checkcurrently reports formatting differences in pre-existing untouched files undercrates/codex-plus-data/, so this PR intentionally avoids formatting unrelated files.Manual Windows Validation
Then inspect the listed processes with Process Explorer's
Elevatedcolumn, or with a local token probe. Expected result: the official Codex process tree launched by Codex++ is elevated when Codex++ itself is elevated.Local validation result: launching Codex++ as administrator created the official Codex main process with
codex-plus-plus.exeas its parent, and the activecodex.exe,node_repl.exe, and PowerShell worker processes were elevated.