codex icon indicating copy to clipboard operation
codex copied to clipboard

Bug: @ file picker surfaces .git refs/logs entries

Open dnevzorov opened this issue 8 months ago • 4 comments

Problem

@ file picker suggestions include Git internal reference/log files (for example .git/refs/... and .git/logs/refs/...).

This is confusing because the picker is expected to show project files intended for code context, not VCS internals.

Environment

  • Codex Desktop: 26.228.1430 (760)
  • Codex CLI: 0.106.0
  • OS: macOS 26.3 (25D125)
  • Architecture: arm64

Reproduction

  1. Open Codex in any Git repository that has local or remote branches.
  2. In the prompt input, type @ followed by a partial term matching a branch-like token (for example a feature name segment).
  3. Observe suggestions/results.

Actual Behavior

Suggestions include entries under:

  • .git/refs/...
  • .git/logs/refs/...

Expected Behavior

@ file picker should exclude Git internals and only show relevant workspace files.

Action Plan

  • [ ] Confirm whether file picker is bypassing ignore rules for hidden/VCS directories.
  • [ ] Ensure .git/** is excluded across CLI, desktop app, and extension for consistent behavior.
  • [ ] Add regression tests for @ completion/search with repositories containing refs/logs.

Acceptance Criteria

  • [ ] @ suggestions never include .git/** entries.
  • [ ] Project files remain searchable as before.
  • [ ] Behavior is consistent across Codex surfaces.

dnevzorov avatar Mar 03 '26 17:03 dnevzorov

Additional confirmation: reproducible in Codex CLI as well.

Environment:

  • Codex CLI: 0.106.0

Observed behavior in CLI @ suggestions:

  • .git/refs/heads/...
  • .git/logs/refs/heads/...
  • .git/filter-repo/...

Example repro in CLI:

  1. Open any Git repository with multiple branches.
  2. Type @utils (or another token matching branch/file-like text).
  3. Suggestions include .git/** entries instead of only workspace source files.

dnevzorov avatar Mar 03 '26 17:03 dnevzorov

Still an issue in 0.110.0, in the TUI, and has been an issue for a long time now. I've stopped using this feature entirely because of it

Image

E: Does not seem to respect .gitignore, .rgignore, etc, it used to do this at some point

doublemover avatar Mar 05 '26 14:03 doublemover

I have the same issue on codex-cli 0.145.0

Image

esadakcam avatar Jul 24 '26 08:07 esadakcam

(response from codex)

Thanks for the report. The @ picker searches hidden directories by design so you can mention project files like .github/workflows/ci.yml. We chose to include all dot-directories, which also makes Git refs and reflogs searchable. I reproduced the reported results and confirmed that the picker respected .gitignore.

To hide Git internals, add .git on its own line to a .ignore file at the repository root. I verified that this removed the ref and reflog from the results while keeping the matching source file and GitHub workflow searchable.

I’m closing this as working as designed.

etraut-openai avatar Nov 21 '26 23:11 etraut-openai