refactor: eliminate getCheckoutStatusLite, use WorkspaceGitService

Route all git checkout queries through WorkspaceGitService instead of
shelling out to git on every call. This makes fetch_agents_request
instant when warm (cached in-memory snapshots) and deduplicates
concurrent cold-start refreshes via ensureWorkspaceTarget.

- buildProjectPlacementForCwd now uses workspaceGitService.getSnapshot()
- worktree-session call sites use WorkspaceGitService
- Deleted getCheckoutStatusLite and its 4 return types from checkout-git
- Fixed cold-start thundering herd: getSnapshot deduplicates via
  ensureWorkspaceTarget instead of spawning parallel git processes
- Extracted checkout-diff logic into WorkspaceGitService
This commit is contained in:
Mohamed Boudra
2026-04-14 19:05:36 +07:00
parent 3cdadd362c
commit 345729c588
19 changed files with 967 additions and 567 deletions
@@ -288,7 +288,6 @@ export function useSidebarWorkspacesList(options?: {
if (!serverId) {
return;
}
}, [connectionStatus, hasHydratedWorkspaces, projects, serverId, sessionWorkspaces]);
useEffect(() => {