fix: Improve Windows path detection in configLoader

Enhanced isFilePath function to properly detect Windows absolute paths,
UNC paths, and paths with file extensions. This fixes test failures on
Windows where paths like "C:\Users\..." were incorrectly treated as
assistant slugs instead of file paths.

Changes:
- Added Windows drive letter pattern detection (C:\, D:\, etc.)
- Added UNC path detection (\\server\share)
- Added file extension detection (.yaml, .yml, .json)

Fixes Windows CI test failure: "Invalid assistant slug format" error
when --config points to non-existent Windows file paths.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Patrick Erichsen 2025-08-05 16:59:25 -07:00
parent 3549ba75e1
commit 0f377203e5

View file

@ -313,7 +313,15 @@ function isFilePath(configPath: string): boolean {
return (
configPath.startsWith(".") ||
configPath.startsWith("/") ||
configPath.startsWith("~")
configPath.startsWith("~") ||
// Windows absolute paths (C:\, D:\, etc.)
/^[A-Za-z]:[/\\]/.test(configPath) ||
// UNC paths (\\server\share)
configPath.startsWith("\\\\") ||
// Contains file extension
configPath.includes(".yaml") ||
configPath.includes(".yml") ||
configPath.includes(".json")
);
}