From 83c7a54acec8f03954b2dfa170f0e7b82993ef7a Mon Sep 17 00:00:00 2001 From: Grayson Keaton Date: Fri, 4 Sep 2026 16:24:09 -0400 Subject: [PATCH 1/2] Fix windows codex executable resolution --- src/ucode/agents/codex.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ucode/agents/codex.py b/src/ucode/agents/codex.py index 625329f3..3d0888c0 100644 --- a/src/ucode/agents/codex.py +++ b/src/ucode/agents/codex.py @@ -554,8 +554,12 @@ def _app_server_start_model() -> str: # inherited (no capture), so Ctrl-C reaches codex directly and the resulting # KeyboardInterrupt propagates past the retry check — quitting an interactive # session is never mistaken for a --profile rejection. + import shutil + resolved_binary = shutil.which(binary) or binary + if not resolved_binary: + raise RuntimeError(f"Unable to locate {binary} on PATH") started = time.monotonic() - returncode = subprocess.run([binary, "--profile", CODEX_PROFILE_NAME, *tool_args]).returncode + returncode = subprocess.run([resolved_binary, "--profile", CODEX_PROFILE_NAME, *tool_args]).returncode if returncode != 0 and time.monotonic() - started < _PROFILE_REJECTED_MAX_SECONDS: # Fast failure: most likely codex rejected --profile on this subcommand. # Relaunch without it, handing over the terminal. (A fast failure for @@ -570,7 +574,7 @@ def _app_server_start_model() -> str: f"without it: Codex will resolve {LEGACY_CODEX_CONFIG_PATH} and any OS-managed " "settings instead of the ucode profile." ) - exec_or_spawn([binary, *tool_args]) + exec_or_spawn([resolved_binary, *tool_args]) return # unreachable in production (exec replaces the process) sys.exit(returncode) From fa46a1051c8e6d53b7e4499d1ec1dd3ba96167c3 Mon Sep 17 00:00:00 2001 From: Grayson Keaton Date: Fri, 4 Sep 2026 16:28:25 -0400 Subject: [PATCH 2/2] Fix Windows Codex executable resolution --- src/ucode/agents/codex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ucode/agents/codex.py b/src/ucode/agents/codex.py index 3d0888c0..36026ed1 100644 --- a/src/ucode/agents/codex.py +++ b/src/ucode/agents/codex.py @@ -8,6 +8,7 @@ import subprocess import sys import time +import shutil from collections.abc import Callable from pathlib import Path @@ -554,7 +555,6 @@ def _app_server_start_model() -> str: # inherited (no capture), so Ctrl-C reaches codex directly and the resulting # KeyboardInterrupt propagates past the retry check — quitting an interactive # session is never mistaken for a --profile rejection. - import shutil resolved_binary = shutil.which(binary) or binary if not resolved_binary: raise RuntimeError(f"Unable to locate {binary} on PATH")