tui onboarding: warn when trusting git subdirectories
Resolved 💬 5 comments Opened Apr 18, 2026 by joycebeatriz Closed Apr 20, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
Summary
When a user runs Codex from a subdirectory within a Git repository and chooses to trust the directory, it's unclear that the trust decision applies to the repository root, not just the current directory.
Proposal
Add a yellow warning message in the TUI onboarding screen that clarifies when the user is in a Git subdirectory, showing which directory will actually be trusted.
Implementation
The fix has been implemented and tested at: https://github.com/joycebeatriz/codex/pull/1
- Added conditional warning message when
cwd != trust_target - Updated snapshot tests
- Included Contributor Covenant v3.0 adoption
5 Comments
Valid enhancement the codebase already has a
// TODO: add git warning.comment at exactly the right spot (onboarding_screen.rs:142), andTrustDirectoryWidgetalready carries bothcwdandtrust_targetfields, so the scaffolding is all there.Proposed Implementation
1.
codex-rs/tui/src/onboarding/trust_directory.rs— add warning block inrender_refAfter line 51 (the \"You are in ...\" line), insert a conditional yellow warning when
cwd != trust_target:2.
codex-rs/tui/src/onboarding/onboarding_screen.rs:142remove the TODOThe TODO comment can be dropped once the widget handles the warning itself (it already receives
trust_target).3. Add snapshot test
Why this approach
trust_targetis already plumbed all the way through to the widgeterrorfieldcwd != trust_targetis the exact same check the existing TODO implies@etraut-openai happy to open a PR for this if it looks good to you.
Hi @itsmejay80 and @etraut-openai!! I implemented this earlier today, and the fix is ready at [https://github.com/joycebeatriz/codex/tree/joyce/onboarding-git-root-warning](vscode-file://vscode-app/Users/joyce/Documents/Programas/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/workbench.html); since I don’t have collaborator access to open a PR directly, I wanted to flag it here in case you’d like to review or pull it in, and I’m happy to make any adjustments needed.
@joycebeatriz, we don't generally accept external code contributions. It's more work for us to accept, review and validate such changes than it is for us to have codex write them for us. The important part is the root cause analysis, which you've already provided above (thanks!).
We generally prioritize feature requests based on community upvotes.
Ahhh! Now I get it! @etraut-openai thanks for the clarification!!
This will be addressed in the next release.