Skip to content

WSL + Windows shared working tree on /mnt causes CodeGraph disk I/O error unless CODEGRAPH_DIR is split manually #995

Description

@Jek-Mena

Body

Summary

When the same repo is used from both Windows and WSL, and the repo lives
under /mnt/c/..., CodeGraph can fail in WSL with disk I/O error unless
CODEGRAPH_DIR is manually split (for example .codegraph on Windows and
.codegraph-wsl on WSL).

It looks like CodeGraph already knows this scenario is unsafe, but the
default behavior still allows WSL to hit the Windows-owned .codegraph
first.

Environment

  • Windows 11
  • WSL
  • repo located at /mnt/c/...
  • same repo accessed from both Windows and WSL
  • CodeGraph version: 1.0.1

Actual behavior

From WSL, CodeGraph failed with:

  • Failed to get status: disk I/O error
  • Explore failed: disk I/O error

Daemon log also showed socket issues on /mnt/c/...:

  • Failed to start server: listen ENOTSUP: operation not supported on socket /mnt/c/.../.codegraph/daemon.sock

There was also fallback to a Windows named pipe, but the DB path still caused
failure.

Expected behavior

On WSL for repos under /mnt/<drive>/..., CodeGraph should either:

  1. automatically use a separate per-project data dir such as .codegraph- wsl, or
  2. fail with a clear actionable message explaining that Windows and WSL must
    not share the same .codegraph and recommending CODEGRAPH_DIR=.codegraph- wsl.

Workaround

I fixed it locally by making WSL use:

CODEGRAPH_DIR=.codegraph-wsl

After that:

- WSL used .codegraph-wsl
- Windows kept using .codegraph
- codegraph status and codegraph explore worked normally from WSL

## Notes

The current source/docs already seem aware of this issue:

- shared Windows/WSL index risks corruption
- CODEGRAPH_DIR is the intended mitigation

So this seems less like missing capability and more like missing automatic
handling / missing diagnostic UX.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions