Fix remote CI environment routing#22197
Conversation
Co-authored-by: Codex <noreply@openai.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e7fc6966bd
ℹ️ 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".
| use std::os::unix::fs::MetadataExt; | ||
|
|
||
| dir.parent().is_none() | ||
| || dir.metadata().is_ok_and(|metadata| { |
There was a problem hiding this comment.
Classify remote project markers with the remote filesystem
find_project_root first checks marker existence via ExecutorFileSystem, but the ambient-dir test then calls dir.metadata() on the local host path. For a remote cwd under a sticky/world-writable directory, the remote .git marker is accepted whenever the same local path is missing/not sticky, so project config can be rooted at the wrong ambient directory.
Useful? React with 👍 / 👎.
| use std::os::unix::fs::MetadataExt; | ||
|
|
||
| dir.parent().is_none() | ||
| || dir.metadata().is_ok_and(|metadata| { |
There was a problem hiding this comment.
Avoid local stat when loading remote repo skills
Repo skill discovery uses the selected ExecutorFileSystem for .git lookup, then decides whether to ignore it with dir.metadata() against the local filesystem. In remote sessions this can classify the remote ancestor using unrelated host permissions, causing ambient remote .git markers to expose the wrong .agents/skills tree or hide a valid one.
Useful? React with 👍 / 👎.
| use std::os::unix::fs::MetadataExt; | ||
|
|
||
| dir.parent().is_none() | ||
| || dir.metadata().is_ok_and(|metadata| { |
There was a problem hiding this comment.
Resolve remote git roots without host metadata
get_git_repo_root_with_fs is meant to operate on the provided executor filesystem, but the ambient marker check uses local dir.metadata(). When the remote workspace is under a sticky/world-writable directory that differs from the host, the remote .git marker is not ignored (or a valid remote repo is skipped), breaking trust/diff root resolution.
Useful? React with 👍 / 👎.
Summary
.gitmarkers in sticky/world-writable directories during project root discoveryContext
The
rust-ci-full / Tests — ubuntu-24.04 - x86_64-unknown-linux-gnu (remote)lane was repeatedly picking up remote-only path/startup failures. This narrows the repair to the environment-routing and remote-test harness pieces that removed those deterministic failures from the target lane.Validation
git diff --checkrust-ci-fullon the branch; the prior deterministic remote-env/view-image/apply-patch/unified-exec startup failures stopped recurring, while unrelated flakes still appeared in the target lane