Incorrect Windows Path Handling Prevents Filesystem Operations #123

Closed
opened 2026-02-16 08:19:58 -05:00 by yindo · 1 comment
Owner

Originally created by @EgoAlpha on GitHub (Nov 10, 2025).

Incorrect Windows Path Handling Prevents Filesystem Operations

Description

On Windows systems, filesystem operations like listing directory contents (ls) fail due to incorrect path handling. When an agent attempts to access an absolute Windows path (e.g., C:\Users\...), the system incorrectly reports the directory as empty.

This is caused by two primary issues:

  1. Path Validation Error: The middleware incorrectly prepends a leading slash to absolute Windows paths (e.g., C:\... becomes /C:/...).
  2. Inconsistent Separators: The filesystem backend returns paths with a mix of forward slashes and backslashes, breaking cross-platform compatibility and causing test failures.

Steps to Reproduce

  1. Set up the environment on a Windows machine.
  2. Run the deepagents application.
  3. Instruct the agent to list the contents of the current working directory (e.g., using the ls(.) tool).

Expected Behavior

The agent should correctly list the files and directories in the specified Windows path.

Actual Behavior

The agent incorrectly reports that the directory is empty. This happens because the malformed path (e.g., /C:/...) fails to resolve correctly in the filesystem backend.

Root Cause

The _validate_path() function does not properly detect absolute Windows paths and incorrectly modifies them. This leads to path resolution failure in FilesystemBackend._resolve_path(), which returns an empty list.

Originally created by @EgoAlpha on GitHub (Nov 10, 2025). ### **Incorrect Windows Path Handling Prevents Filesystem Operations** **Description** On Windows systems, filesystem operations like listing directory contents (`ls`) fail due to incorrect path handling. When an agent attempts to access an absolute Windows path (e.g., `C:\Users\...`), the system incorrectly reports the directory as empty. This is caused by two primary issues: 1. **Path Validation Error**: The middleware incorrectly prepends a leading slash to absolute Windows paths (e.g., `C:\...` becomes `/C:/...`). 2. **Inconsistent Separators**: The filesystem backend returns paths with a mix of forward slashes and backslashes, breaking cross-platform compatibility and causing test failures. **Steps to Reproduce** 1. Set up the environment on a Windows machine. 2. Run the `deepagents` application. 3. Instruct the agent to list the contents of the current working directory (e.g., using the `ls(.)` tool). **Expected Behavior** The agent should correctly list the files and directories in the specified Windows path. **Actual Behavior** The agent incorrectly reports that the directory is empty. This happens because the malformed path (e.g., `/C:/...`) fails to resolve correctly in the filesystem backend. **Root Cause** The `_validate_path()` function does not properly detect absolute Windows paths and incorrectly modifies them. This leads to path resolution failure in `FilesystemBackend._resolve_path()`, which returns an empty list.
yindo added the bugneeds investigationbackends labels 2026-02-16 08:19:58 -05:00
yindo closed this issue 2026-02-16 08:19:58 -05:00
Author
Owner

@sydney-runkle commented on GitHub (Jan 16, 2026):

In the short term, we don't intend to support windows. Going to close for now as not planned.

@sydney-runkle commented on GitHub (Jan 16, 2026): In the short term, we don't intend to support windows. Going to close for now as not planned.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/deepagents#123