Skip to content

MCP server hangs indefinitely on Windows + OneDrive paths during indexing #3

@aditya-nawal

Description

@aditya-nawal

Environment:

  • OS: Windows 11
  • Shell: bash (Git Bash / Claude Code CLI)
  • Project path: OneDrive-synced folder (C:\Users...\xyz)
  • token-savior version: (installed via venv at ~/.local/token-savior-venv/)
  • Client: claude-code

What happens:

set_project_root and startup indexing via WORKSPACE_ROOTS hang indefinitely — no response, no error, no timeout. The process stays alive (shows in tasklist) but uses barely any RAM (~11MB) and never
completes.


What we tried:

  1. Full project root in WORKSPACE_ROOTS → hung for 10+ minutes, process showed 11MB RAM (not a memory issue)
  2. Added EXTRA_EXCLUDE_PATTERNS (wrong env var — we later discovered the correct name is EXCLUDE_EXTRA) → exclusions were silently ignored, still hung
  3. Scoped WORKSPACE_ROOTS to only experiment2/ (895 files) → still hung 15+ min
  4. Added EXCLUDE_EXTRA with /outputs/ to remove JSONL data files → still hung
  5. Added INCLUDE_PATTERNS=**/*.py to limit to 53 Python files, single glob traversal → still hung

In all cases: process starts, uses ~11MB RAM, and never returns a response within 15+ minutes.


Root cause hypothesis:

The project lives on a Windows OneDrive-synced folder. Even when OneDrive sync is paused, Windows keeps an NTFS filesystem filter driver active on OneDrive paths. This intercepts every file open/stat call to
check sync status, making directory traversal and file reads extremely slow.

Specifically:

  • pathlib.Path.glob() traverses the full directory tree once per include pattern (10 traversals by default for **/.py, **/.ts, **/*.json, etc.)
  • Each file stat/open on OneDrive goes through the filter driver
  • Result: what takes <1 second on a local path takes 15+ minutes on an OneDrive path

Confirming evidence: get_project_summary (which doesn't trigger indexing) returns instantly. Only operations that trigger _build_slot → slot.indexer.index() hang.


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