mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 22:03:45 +00:00
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:
parent
43a1c1ae44
commit
a2dc1187dc
2 changed files with 59 additions and 58 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue