fix: ignore dangerous project-level config keys#20098
Merged
Merged
Conversation
bolinfest
reviewed
Apr 30, 2026
726716f to
f581d35
Compare
17bf1df to
5e21418
Compare
bolinfest
approved these changes
Apr 30, 2026
| pub raw_toml: Option<String>, | ||
| pub version: String, | ||
| pub disabled_reason: Option<String>, | ||
| pub warnings: Vec<String>, |
Collaborator
There was a problem hiding this comment.
Let's change this to Option<Vec<String>> so:
Nonemeans "not checked for warnings" (default)Some(vec![])means "checked and there were no warnings"- otherwise: checked and here are the warnings
Incidentally, when the type is Option<Vec<T>>, Some(vec![]) and vec![] would both take up three words because the first word is a pointer (which must be non-zero), so I believe the Option<Vec<String>> shouldn't take up more space than Vec<String> in this case.
| } else { | ||
| ConfigLayerEntry::new(source, config) | ||
| }; | ||
| entry.with_warnings(warnings) |
Collaborator
There was a problem hiding this comment.
thanks, this feels better
| let ignored_keys = ignored_keys.join(", "); | ||
| format!( | ||
| concat!( | ||
| "Ignored unsupported project-local config keys in {}: {}. ", |
Collaborator
There was a problem hiding this comment.
consider
Suggested change
| "Ignored unsupported project-local config keys in {}: {}. ", | |
| "Ignored unsupported project-local config keys in {config_path}: {ignored_keys}. ", | |
| ... | |
| config_path = config_path.display(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Ignore these top-level config keys when loading project-scoped config.toml files:
What changed
openai_base_url,chatgpt_base_url,model_provider,model_providers,profile,profiles, andexperimental_realtime_ws_base_url.config.tomlif they intentionally need them.profile/profilesentries are ignored instead of overriding user-level profile selection.Verification
cargo test -p codex-configcargo test -p codex-core project_layer_ignores_unsupported_config_keyscargo test -p codex-core project_profiles_are_ignoredcargo test -p codex-core config::config_loader_tests