Honor cloud-managed requirements in feature listings (#38581)

## What changed

- Load configuration for `codex features list` through the shared cloud-aware
  loader so managed feature requirements are reflected in the reported state.
- Reuse that loader for MCP commands.

## Testing

- Add an integration test showing that a cloud-managed requirement can disable
  `fast_mode` in `codex features list` without rewriting the user's
  `config.toml`.

GitOrigin-RevId: 2bdbc76dfa40ceb29e8293556f4b56cabbd2c43f
This commit is contained in:
jif authored and copyberry committed 2026-08-14 13:50:10 +00:00
1 parent 2a452d7dc1
commit 7c194ff24b
4 files changed
+114 -23

No files matched your search

+7 -12
View File
@@ -45,6 +45,7 @@ use supports_color::Stream;
#[cfg(any(target_os = "macos", target_os = "windows"))]
mod app_cmd;
mod cloud_config;
#[cfg(any(target_os = "macos", target_os = "windows"))]
mod desktop_app;
mod doctor;
@@ -1640,22 +1641,16 @@ async fn cli_main(
root_remote_auth_token_env.as_deref(),
"features list",
)?;
let mut cli_kv_overrides = root_config_overrides
.parse_overrides()
.map_err(anyhow::Error::msg)?;
// Honor `--search` via the canonical web_search mode.
if interactive.web_search {
cli_kv_overrides.push((
"web_search".to_string(),
toml::Value::String("live".to_string()),
));
root_config_overrides
.raw_overrides
.push("web_search=\"live\"".to_string());
}
let config = ConfigBuilder::default()
.cli_overrides(cli_kv_overrides)
.build()
.await?;
let config =
cloud_config::load_config(&root_config_overrides, LoaderOverrides::default())
.await?;
let mut rows = Vec::with_capacity(FEATURES.len());
let mut name_width = 0;
let mut stage_width = 0;