-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Skip loading codex home as project layer #10207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@codex please review |
| 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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason you need both here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this feels unnecessary to me but also don't think it's actively harmful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah its an uncommon situation but certainly does happen
gt-oai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
| 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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this feels unnecessary to me but also don't think it's actively harmful
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.