Skip loading codex home as project layer#10207
Merged
daniel-oai merged 2 commits intomainfrom Jan 30, 2026
Merged
Conversation
Contributor
Author
|
@codex please review |
xl-openai
reviewed
Jan 30, 2026
| let dot_codex_abs = AbsolutePathBuf::from_absolute_path(&dot_codex)?; | ||
| let dot_codex_normalized = | ||
| normalize_path(dot_codex_abs.as_path()).unwrap_or_else(|_| dot_codex_abs.to_path_buf()); | ||
| if dot_codex_abs == codex_home_abs || dot_codex_normalized == codex_home_normalized { |
Collaborator
There was a problem hiding this comment.
Any reason you need both here?
Contributor
Author
There was a problem hiding this comment.
The first is a cheap, reliable equality check. The second handles symlinked or differently-canonicalized paths (which can happen with worktrees, temp dirs, or custom $CODEX_HOME).
Contributor
There was a problem hiding this comment.
this feels unnecessary to me but also don't think it's actively harmful
Contributor
Author
There was a problem hiding this comment.
Yeah its an uncommon situation but certainly does happen
gt-oai
approved these changes
Jan 30, 2026
| let dot_codex_abs = AbsolutePathBuf::from_absolute_path(&dot_codex)?; | ||
| let dot_codex_normalized = | ||
| normalize_path(dot_codex_abs.as_path()).unwrap_or_else(|_| dot_codex_abs.to_path_buf()); | ||
| if dot_codex_abs == codex_home_abs || dot_codex_normalized == codex_home_normalized { |
Contributor
There was a problem hiding this comment.
this feels unnecessary to me but also don't think it's actively harmful
xl-openai
approved these changes
Jan 30, 2026
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.
Summary:
$CODEX_HOME(typically~/.codex) from being discovered as a project.codexlayer by skipping it during project layer traversal. We compare both normalized absolute paths and best-effort canonicalized paths to handle symlinks.CODEX_HOMEpoints to a project.codexdirectory (e.g., worktrees/editor integrations).Testing:
cargo build -p codex-cli --bin codexcargo build -p codex-rmcp-client --bin test_stdio_servercargo test -p codex-corecargo test --all-featurestarget/debug/codexfrom~and confirmed the disabled-folder warning and trust prompt no longer appear.