Skip to content

Codex Desktop’s Windows workspace-write sandbox creates an empty <workspace>\.git directory in a workspace that is not a Git repository #32872

Open

Description

@joe-miles

What version of the Codex App are you using (From “About Codex” dialog)?

Version 26.707.30751

What subscription do you have?

Enterprise

What platform is your computer?

Windows 11

What issue are you seeing?

The sandbox appears to materialize the missing path so it can apply a deny
ACL. Because .git is a repository-discovery sentinel, its mere existence
changes the behavior of Visual Studio and other developer tools.

In this case, Visual Studio detects malformed Git metadata above a large,
explicitly TFVC-bound solution and fails to load the solution.

Environment

  • Codex Desktop: 26.707.3351.0
  • Platform: Microsoft Windows NT 10.0.26200.8655 x64
  • Sandbox mode: workspace-write
  • Windows sandbox configuration: [windows] sandbox = "elevated"
  • Visual Studio: 18 Professional
  • Source control: TFVC, not Git
  • Solution: 88 TFVC-bound projects

Correlated evidence

An apply_patch began at approximately:

2026-07-10T16:02:42.867Z

The sandbox log then recorded:

[2026-07-10 10:02:43.265 codex.exe] setup refresh: spawning
codex-windows-sandbox-setup.exe
(cwd=<workspace>)

[2026-07-10T16:02:43.434435600+00:00]
applied deny ACE to protect <workspace>\.git

The resulting .git directory contained no HEAD, config, refs, objects,
or other metadata. Git itself reported that the directory was not a Git
repository.

The same sandbox behavior was independently observed in another workspace
and in Codex-generated visualization roots. The directories’ creation
timestamps exactly matched the ACL operations in the sandbox log.

The solution contains:

GlobalSection(TeamFoundationVersionControl) = preSolution
SccNumberOfProjects = 88

There is no git init, clone, worktree, or project script creating .git.

Impact

  • Silently mutates the user’s source workspace.
  • Imposes Git repository semantics on non-Git workspaces.
  • Breaks Visual Studio/TFVC solution loading.
  • Reappears after manual cleanup.
  • Makes Codex write mode unusable with this workspace.

Expected behavior

Codex must never create a reserved source-control discovery sentinel merely
to protect it.

If .git exists, protecting it is reasonable. If it does not exist, the
sandbox must skip that path or use a mechanism that does not materialize it.

The behavior must also be tested with non-Git workspaces, including TFVC,
Perforce, Subversion, Mercurial, and workspaces with no source control.

What steps can reproduce the bug?

Steps to reproduce

  1. Start with a known non-Git workspace and verify that <workspace>\.git
    does not exist.
  2. Open that workspace in Codex Desktop using workspace-write.
  3. Trigger an edit that uses apply_patch.
  4. Observe Windows sandbox setup/refresh.
  5. Observe that <workspace>\.git now exists and is completely empty.
  6. Open a Visual Studio solution beneath that workspace that is explicitly
    bound to TFVC.
  7. Visual Studio detects the ancestor .git marker and solution loading fails.
  8. Delete the empty .git, restart Visual Studio, and solution loading works.
  9. A later Codex sandbox refresh recreates .git.

What is the expected behavior?

I expect it not to be so dumb as to randomly add source control files/folders that I clearly don't use. I expect the developers to be know that Git is NOT the only source control system in the world.

Additional information

No response

Activity

  1. added
    appIssues related to the Codex desktop app
    on Jul 13, 2026
  2. added
    bugSomething isn't working
    windows-osIssues related to Codex on Windows systems
    sandboxIssues related to permissions or sandboxing
    on Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingsandboxIssues related to permissions or sandboxingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions