Skip to content

feat: config aliases#18140

Merged
jif-oai merged 7 commits into
mainfrom
jif/rename-param
Apr 17, 2026
Merged

feat: config aliases#18140
jif-oai merged 7 commits into
mainfrom
jif/rename-param

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

@jif-oai jif-oai commented Apr 16, 2026

Rename no_memories_if_mcp_or_web_searchdisable_on_external_context with backward compatibility

While doing so, we add a key alias system on our layer merging system. What we try to avoid is a case where a company managed config use an old name while the user has a new name in it's local config (which would make the deserialization fail)

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 97efe279c3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/config/src/types.rs
jif-oai added 3 commits April 16, 2026 15:15
# Conflicts:
#	codex-rs/core/src/stream_events_utils.rs
#	codex-rs/core/src/stream_events_utils_tests.rs
@jif-oai jif-oai changed the title chore: rename pollution feat: config aliases Apr 16, 2026
@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented Apr 17, 2026

@codex review

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

let effective_value = value_at_path(effective, segments);

P2 Badge Normalize alias key paths before override detection

compute_override_metadata compares segments literally against effective. After this change, effective config canonicalizes memories.no_memories_if_mcp_or_web_search to memories.disable_on_external_context, so writes using the legacy key can be misreported as overridden with effective_value = null even when no higher layer overrides them.


validate_config(&user_config).map_err(|err| {

P1 Badge Normalize aliases before validating user-layer writes

User-layer writes validate user_config directly, but this value is not alias-normalized first. If a user file contains both legacy and canonical memory keys, writes to unrelated paths fail with config validation errors despite merge logic intending to canonicalize aliases. This blocks configuration updates for otherwise loadable configs.


let effective_value = value_at_path(effective, segments);

P2 Badge Canonicalize key paths before computing override metadata

Override detection uses the raw edited key path against effective, which is now canonicalized. Editing via legacy path can produce effective_value = null and mark the write as overridden even when no higher-precedence layer overrides it. This yields incorrect status/metadata in write responses.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/config/src/merge.rs
Comment thread codex-rs/config/src/merge.rs

/// Merge config `overlay` into `base`, giving `overlay` precedence.
pub fn merge_toml_values(base: &mut TomlValue, overlay: &TomlValue) {
merge_toml_values_at_path(base, overlay, &mut Vec::new());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Badge Preserve merge path when normalizing aliased keys

merge_toml_values always initializes with an empty path, so alias normalization only runs correctly when merging from config root. Subtree merges (e.g. upserting memories in config write APIs) skip alias rewriting, allowing legacy and canonical keys to coexist and later fail typed deserialization as duplicate fields.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

all of this is the same comment... not applicable here

@jif-oai jif-oai merged commit cfc23ee into main Apr 17, 2026
35 of 36 checks passed
@jif-oai jif-oai deleted the jif/rename-param branch April 17, 2026 17:26
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants