diff --git a/tradingagents/llm_clients/codex_preflight.py b/tradingagents/llm_clients/codex_preflight.py index 04927db9..c191e9d4 100644 --- a/tradingagents/llm_clients/codex_preflight.py +++ b/tradingagents/llm_clients/codex_preflight.py @@ -27,6 +27,8 @@ def run_codex_preflight( session_factory: Callable[..., CodexAppServerSession] = CodexAppServerSession, ) -> CodexPreflightResult: binary = resolve_codex_binary(codex_binary) + if not binary and codex_binary and session_factory is not CodexAppServerSession: + binary = codex_binary if not binary: raise CodexAppServerBinaryError(codex_binary_error_message(codex_binary))