Skip to content

Clarify codex_home base for MDM path resolution#15707

Merged
evawong-oai merged 4 commits into
mainfrom
codex/mdm-codex-home-comment
Mar 25, 2026
Merged

Clarify codex_home base for MDM path resolution#15707
evawong-oai merged 4 commits into
mainfrom
codex/mdm-codex-home-comment

Conversation

@evawong-oai

@evawong-oai evawong-oai commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Add the follow up code comment Michael asked for at the MDM managed_config_from_mdm - a follow up from #15351.

Validation

  1. cargo fmt --all --check
  2. cargo test -p codex-core managed_preferences_expand_home_directory_in_workspace_write_roots -- --nocapture
  3. cargo test -p codex-core write_value_succeeds_when_managed_preferences_expand_home_directory_paths -- --nocapture
  4. ./tools/argument-comment-lint/run-prebuilt-linter.sh -p codex-core

@evawong-oai evawong-oai force-pushed the codex/mdm-codex-home-comment branch from 60e47c8 to 1195fce Compare March 25, 2026 15:18
@evawong-oai evawong-oai marked this pull request as ready for review March 25, 2026 15:18

@bolinfest bolinfest left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Here is the language I would use instead: I want to make it clear that ./ is not intentionally supported in this case.

Comment thread codex-rs/core/src/config_loader/mod.rs Outdated
Comment on lines +288 to +291
// Use codex_home as the synthetic base so AbsolutePathBufGuard expands
// both `~` and `./` here. MDM should prefer `~` or other absolute
// paths; we continue to resolve `./` for compatibility with existing
// managed configs.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// Use codex_home as the synthetic base so AbsolutePathBufGuard expands
// both `~` and `./` here. MDM should prefer `~` or other absolute
// paths; we continue to resolve `./` for compatibility with existing
// managed configs.
// As a general rule, config from MDM should _not_ include relative paths,
// starting with `./`, but a path starting with `~/` _is_ a supported use case.
// Because resolve_relative_paths_in_config_toml() relies on
// AbsolutePathBufGuard to resolve `~/`, we must supply a value for base_dir,
// so codex_home is a good a value as any.

@evawong-oai evawong-oai enabled auto-merge (squash) March 25, 2026 16:23
@evawong-oai evawong-oai merged commit 6566ab7 into main Mar 25, 2026
82 of 93 checks passed
@evawong-oai evawong-oai deleted the codex/mdm-codex-home-comment branch March 25, 2026 18:40
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 25, 2026
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.

3 participants