tui: show non-file layer content in /debug-config (#11412)

The debug output listed non-file-backed layers such as session flags and
MDM managed config, but it did not show their values. That made it
difficult to explain unexpected effective settings because users could
not inspect those layers on disk.

Now `/debug-config` might include output like this:

```
Config layer stack (lowest precedence first):
  1. system (/etc/codex/config.toml) (enabled)
  2. user (/Users/mbolin/.codex/config.toml) (enabled)
  3. legacy managed_config.toml (mdm) (enabled)
     MDM value:
       # Production Codex configuration file.

       [otel]
       log_user_prompt = true
       environment = "prod"
       exporter = { otlp-http = {
         endpoint = "https://example.com/otel",
         protocol = "binary"
       }}
```
This commit is contained in:
Michael Bolin
2026-02-10 22:23:08 -08:00
committed by GitHub
parent fdd0cd1de9
commit f6dd9e37e7
6 changed files with 223 additions and 20 deletions

View File

@@ -278,9 +278,10 @@ pub async fn load_config_layers_state(
));
}
if let Some(config) = managed_config_from_mdm {
layers.push(ConfigLayerEntry::new(
layers.push(ConfigLayerEntry::new_with_raw_toml(
ConfigLayerSource::LegacyManagedConfigTomlFromMdm,
config,
config.managed_config,
config.raw_toml,
));
}
@@ -485,7 +486,12 @@ async fn load_requirements_from_legacy_scheme(
} = loaded_config_layers;
for (source, config) in managed_config_from_mdm
.map(|config| (RequirementSource::LegacyManagedConfigTomlFromMdm, config))
.map(|config| {
(
RequirementSource::LegacyManagedConfigTomlFromMdm,
config.managed_config,
)
})
.into_iter()
.chain(managed_config.map(|c| {
(