From 5562860da4b4785ee5ccdd96a2a5601bff677614 Mon Sep 17 00:00:00 2001 From: Rik Schreurs Date: Fri, 1 May 2026 16:35:25 +0200 Subject: [PATCH 1/2] Move worktrees to ~/.Conclave to avoid Windows MAX_PATH issues Worktrees previously lived next to the SQLite db (e.g. %AppData%\Roaming\Conclave\worktrees), which on Windows ate ~50 characters of the 260-char path budget before any repo content. Move them to ~/.Conclave on all platforms so deep file paths inside a worktree stay clear of MAX_PATH. Existing sessions keep working because each session row stores its absolute worktree_path; only newly created sessions land under the new root. Fixes #49. --- src/Conclave.App/Sessions/Database.cs | 11 +++++++++++ src/Conclave.App/Sessions/SessionManager.cs | 3 +-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Conclave.App/Sessions/Database.cs b/src/Conclave.App/Sessions/Database.cs index 6afa4e3..ea28569 100644 --- a/src/Conclave.App/Sessions/Database.cs +++ b/src/Conclave.App/Sessions/Database.cs @@ -160,6 +160,17 @@ public static string DefaultPath() return System.IO.Path.Combine(dir, "conclave.db"); } + // Worktrees live under ~/.Conclave on every platform — separate from the app-data + // directory (which on Windows sits inside AppData\Roaming\Conclave) so per-file paths + // stay clear of Windows' 260-char MAX_PATH limit. Every saved character matters: the + // 32-char project id and slug already cost ~40, and git itself appends paths like + // ".git/worktrees//index.lock" inside the linked worktree. + public static string DefaultWorktreeRoot() + { + var home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); + return System.IO.Path.Combine(home, ".Conclave"); + } + public static long Now() => DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); private void Migrate() diff --git a/src/Conclave.App/Sessions/SessionManager.cs b/src/Conclave.App/Sessions/SessionManager.cs index aae2159..aa70894 100644 --- a/src/Conclave.App/Sessions/SessionManager.cs +++ b/src/Conclave.App/Sessions/SessionManager.cs @@ -50,8 +50,7 @@ public static SessionManager Open(Tokens tokens) { var dbPath = Database.DefaultPath(); var db = Database.Open(dbPath); - var root = Path.Combine(Path.GetDirectoryName(dbPath)!, "worktrees"); - return new SessionManager(db, root, tokens); + return new SessionManager(db, Database.DefaultWorktreeRoot(), tokens); } // --- Loading --- From f050e19e100c70a11eaf5a3b013e2b030906172e Mon Sep 17 00:00:00 2001 From: Rik Schreurs Date: Fri, 1 May 2026 16:36:10 +0200 Subject: [PATCH 2/2] Update new-session modal preview to show ~/.Conclave path --- src/Conclave.App/ViewModels/NewSessionVm.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Conclave.App/ViewModels/NewSessionVm.cs b/src/Conclave.App/ViewModels/NewSessionVm.cs index 6f216f9..ad7a3e2 100644 --- a/src/Conclave.App/ViewModels/NewSessionVm.cs +++ b/src/Conclave.App/ViewModels/NewSessionVm.cs @@ -91,7 +91,7 @@ public string WorktreePath var slug = DeriveSlug(_branch); if (_project.IsFusion) return $"{_project.MemberIds.Count} worktrees · {slug}"; - return $"worktrees/{_project.Id[..8]}/{slug}"; + return $"~/.Conclave/{_project.Id[..8]}/{slug}"; } }