fix: handle Windows paths in session directory generation
- Replace backslashes in addition to forward slashes - Remove colons from Windows drive letters (C:, D:, etc) - Fixes ENOENT error on Windows when creating session directories
This commit is contained in:
@@ -78,7 +78,8 @@ export class SessionManager {
|
||||
|
||||
private getSessionDirectory(): string {
|
||||
const cwd = process.cwd();
|
||||
const safePath = "--" + cwd.replace(/^\//, "").replace(/\//g, "-") + "--";
|
||||
// Replace all path separators and colons (for Windows drive letters) with dashes
|
||||
const safePath = "--" + cwd.replace(/^[/\\]/, "").replace(/[/\\:]/g, "-") + "--";
|
||||
|
||||
const configDir = resolve(process.env.CODING_AGENT_DIR || join(homedir(), ".pi/agent/"));
|
||||
const sessionDir = join(configDir, "sessions", safePath);
|
||||
|
||||
Reference in New Issue
Block a user