core-agent-ide/codex-rs/exec/tests/suite
Michael Bolin de3fa03e1c
feat: change ConfigLayerName into a disjoint union rather than a simple enum (#8095)
This attempts to tighten up the types related to "config layers."
Currently, `ConfigLayerEntry` is defined as follows:


bef36f4ae7/codex-rs/core/src/config_loader/state.rs (L19-L25)

but the `source` field is a bit of a lie, as:

- for `ConfigLayerName::Mdm`, it is
`"com.openai.codex/config_toml_base64"`
- for `ConfigLayerName::SessionFlags`, it is `"--config"`
- for `ConfigLayerName::User`, it is `"config.toml"` (just the file
name, not the path to the `config.toml` on disk that was read)
- for `ConfigLayerName::System`, it seems like it is usually
`/etc/codex/managed_config.toml` in practice, though on Windows, it is
`%CODEX_HOME%/managed_config.toml`:


bef36f4ae7/codex-rs/core/src/config_loader/layer_io.rs (L84-L101)

All that is to say, in three out of the four `ConfigLayerName`, `source`
is a `PathBuf` that is not an absolute path (or even a true path).

This PR tries to uplevel things by eliminating `source` from
`ConfigLayerEntry` and turning `ConfigLayerName` into a disjoint union
named `ConfigLayerSource` that has the appropriate metadata for each
variant, favoring the use of `AbsolutePathBuf` where appropriate:

```rust
pub enum ConfigLayerSource {
    /// Managed preferences layer delivered by MDM (macOS only).
    #[serde(rename_all = "camelCase")]
    #[ts(rename_all = "camelCase")]
    Mdm { domain: String, key: String },
    /// Managed config layer from a file (usually `managed_config.toml`).
    #[serde(rename_all = "camelCase")]
    #[ts(rename_all = "camelCase")]
    System { file: AbsolutePathBuf },
    /// Session-layer overrides supplied via `-c`/`--config`.
    SessionFlags,
    /// User config layer from a file (usually `config.toml`).
    #[serde(rename_all = "camelCase")]
    #[ts(rename_all = "camelCase")]
    User { file: AbsolutePathBuf },
}
```
2025-12-17 08:13:59 -08:00
..
add_dir.rs feat: Add support for --add-dir to exec and TypeScript SDK (#6565) 2025-11-13 13:47:10 -08:00
apply_patch.rs Add codex exec testing helpers (#4254) 2025-09-25 17:12:45 -07:00
auth_env.rs Use response helpers when mounting SSE test responses (#4783) 2025-10-05 21:58:16 +00:00
mod.rs feat: Add support for --add-dir to exec and TypeScript SDK (#6565) 2025-11-13 13:47:10 -08:00
originator.rs feat: change ConfigLayerName into a disjoint union rather than a simple enum (#8095) 2025-12-17 08:13:59 -08:00
output_schema.rs Update defaults to gpt-5.1 (#6652) 2025-11-17 17:40:11 -08:00
resume.rs codex-exec: allow resume --last to read prompt #6717 (#6719) 2025-11-20 13:10:49 -08:00
sandbox.rs fix: introduce AbsolutePathBuf as part of sandbox config (#7856) 2025-12-12 15:25:22 -08:00
server_error_exit.rs tests: replace mount_sse_once_match with mount_sse_once for SSE mocking (#6640) 2025-11-13 18:04:05 -08:00