Regression in 0.149.0: empty .git directory no longer defines the project root
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What changed
After upgrading Codex CLI from 0.148.0 to 0.149.0, an empty .git directory no longer stops the upward project-root search. In a child directory inside a parent Git repository, the terminal title now resolves to the parent repository name.
In 0.148.0, the check was:
if dot_git.exists()
In 0.149.0, it became:
if dot_git.exists() && (!dot_git.is_dir() || dot_git.join("HEAD").exists())
Adding an empty .git/HEAD file restores the old behavior.
Relevant comparison: https://github.com/openai/codex/compare/rust-v0.148.0...rust-v0.149.0
Suggestion
Please consider removing the additional HEAD existence check and restoring the 0.148.0 behavior. A .git directory is normally created either by Git or intentionally by the user. In the intentional case, the user knows they are using it as a project boundary.
Environment
- Codex CLI 0.149.0
- Windows 11 / PowerShell
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Compare the project-root search logic between rust-v0.148.0 and rust-v0.149.0, starting from the .git existence check described in the issue. Restore the behavior where an empty .git directory defines the project boundary, then verify that a child directory inside a parent repository resolves to the intended project root.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100