mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
registerPendingWorktreeWorkspace was subscribing the WorkspaceGitService before the worktree directory existed on disk, caching a stale isGit:false snapshot. When background reconciliation ran, it consumed the stale cache, overwrote the correct workspace record with a wrong projectId, and briefly showed the worktree as a standalone project in the sidebar. Move syncWorkspaceGitWatchTarget from registerPendingWorktreeWorkspace into handleCreatePaseoWorktreeRequest, called after createAgentWorktree, so the first snapshot sees the real worktree — one subscribe, one load, no stale cache to race against.