chore: enusre the logic that creates ConfigLayerStack has access to cwd

This commit is contained in:
Michael Bolin
2025-12-19 18:02:24 -08:00
parent dc61fc5f50
commit 41833c879b
9 changed files with 111 additions and 37 deletions
+11 -1
View File
@@ -44,6 +44,7 @@ use codex_core::features::Feature;
use codex_core::features::FeatureOverrides;
use codex_core::features::Features;
use codex_core::features::is_known_feature_key;
use codex_utils_absolute_path::AbsolutePathBuf;
/// Codex CLI
///
@@ -687,7 +688,16 @@ async fn is_tui2_enabled(cli: &TuiCli) -> std::io::Result<bool> {
.map_err(|e| std::io::Error::new(std::io::ErrorKind::InvalidInput, e))?;
let codex_home = find_codex_home()?;
let config_toml = load_config_as_toml_with_cli_overrides(&codex_home, cli_kv_overrides).await?;
let cwd = cli
.cwd
.clone()
.map(|path| path.canonicalize().unwrap_or(path));
let config_cwd = match cwd.as_deref() {
Some(path) => AbsolutePathBuf::try_from(path)?,
None => AbsolutePathBuf::try_from(std::env::current_dir()?)?,
};
let config_toml =
load_config_as_toml_with_cli_overrides(&codex_home, &config_cwd, cli_kv_overrides).await?;
let config_profile = config_toml.get_config_profile(cli.config_profile.clone())?;
let overrides = FeatureOverrides::default();
let features = Features::from_config(&config_toml, &config_profile, overrides);