openai / openai/codex

Regression in 0.149.0: empty .git directory no longer defines the project root

Open Beginner friendly
#39,963 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug CLI windows-os
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.