mirror of
https://github.com/openai/codex.git
synced 2026-05-15 16:53:05 +00:00
codex: remove duplicate environment manager constructors (#20666)
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -102,30 +102,6 @@ impl EnvironmentManager {
|
||||
Self::from_provider(&provider, local_runtime_paths).await
|
||||
}
|
||||
|
||||
/// Builds a manager from `CODEX_HOME` and local runtime paths used when
|
||||
/// creating local filesystem helpers.
|
||||
///
|
||||
/// If `CODEX_HOME/environments.toml` is present, it defines the configured
|
||||
/// environments. Otherwise this preserves the legacy
|
||||
/// `CODEX_EXEC_SERVER_URL` behavior. Callers that ignore user config
|
||||
/// should use [`Self::from_env`] instead.
|
||||
pub async fn from_codex_home(
|
||||
codex_home: impl AsRef<std::path::Path>,
|
||||
local_runtime_paths: ExecServerRuntimePaths,
|
||||
) -> Result<Self, ExecServerError> {
|
||||
let provider = environment_provider_from_codex_home(codex_home.as_ref())?;
|
||||
Self::from_provider(provider.as_ref(), local_runtime_paths).await
|
||||
}
|
||||
|
||||
/// Builds a manager from the legacy environment-variable provider without
|
||||
/// reading user config files from `CODEX_HOME`.
|
||||
pub async fn from_env(
|
||||
local_runtime_paths: ExecServerRuntimePaths,
|
||||
) -> Result<Self, ExecServerError> {
|
||||
let provider = DefaultEnvironmentProvider::from_env();
|
||||
Self::from_provider(&provider, local_runtime_paths).await
|
||||
}
|
||||
|
||||
async fn from_default_provider_url(
|
||||
exec_server_url: Option<String>,
|
||||
local_runtime_paths: ExecServerRuntimePaths,
|
||||
|
||||
Reference in New Issue
Block a user