Skip to content

feat: honor /etc/codex/config.toml#8461

Merged
bolinfest merged 1 commit intomainfrom
pr8461
Dec 23, 2025
Merged

feat: honor /etc/codex/config.toml#8461
bolinfest merged 1 commit intomainfrom
pr8461

Conversation

@bolinfest
Copy link
Collaborator

@bolinfest bolinfest commented Dec 23, 2025

This adds logic to load /etc/codex/config.toml and associate it with ConfigLayerSource::System on UNIX. I refactored the code so it shares logic with the creation of the ConfigLayerSource::User layer.

Copy link
Collaborator

@joshka-oai joshka-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nits

const DEFAULT_REQUIREMENTS_TOML_FILE_UNIX: &str = "/etc/codex/requirements.toml";

/// On Unix systems, load default settings from this file path, if present.
/// Note that /etc/config/ is treated as a "config folder," so subfolders such
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Note that /etc/config/ is treated as a "config folder," so subfolders such
/// Note that /etc/codex/ is treated as a "config folder," so subfolders such

Comment on lines +113 to +114
// TODO(gt): Determine the path to load on Windows.
None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://crates.io/crates/directories solves this generically (though it chooses the macOS Library folders there, so it's not quite what we want) - the crate page has the right folder paths for windows folders however.

Err(io::Error::new(
e.kind(),
format!(
"Failed to read user config file {}: {e}",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Failed to read user config file {}: {e}",
"Failed to read config file {}: {e}",

io::Error::new(
io::ErrorKind::InvalidData,
format!(
"Error parsing user config file {}: {e}",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Error parsing user config file {}: {e}",
"Error parsing config file {}: {e}",

io::Error::new(
io::ErrorKind::InvalidData,
format!(
"User config file {} has no parent directory",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"User config file {} has no parent directory",
"Config file {} has no parent directory",

@xl-openai
Copy link
Collaborator

For skills we call this "ADMIN" scope, might need to align on the terminology here.

/// On Unix systems, load default settings from this file path, if present.
/// Note that /etc/codex/ is treated as a "config folder," so subfolders such
/// as skills/ and rules/ will also be honored.
pub const SYSTEM_CONFIG_TOML_FILE_UNIX: &str = "/etc/codex/config.toml";
Copy link
Contributor

@gverma-openai gverma-openai Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be admin to conform to https://developers.openai.com/codex/skills . I understand the motivations for system and how it makes sense as config that is system-wide, but we can't have different definitions for different features and it may make sense to stick with admin as a label from a product buckets perspective. The label is also an easier to change in code later even if we decide to perform the heavy lifting of changing skill scope names (which are now proliferated on developer documentation and social media posts/videos), so I suggest sticking with admin for now.

@bolinfest bolinfest merged commit e27d9bd into main Dec 23, 2025
45 of 47 checks passed
@bolinfest bolinfest deleted the pr8461 branch December 23, 2025 03:06
@github-actions github-actions bot locked and limited conversation to collaborators Dec 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants