Add Agent manager

Change-Id: Iaa68e9228165bd274f9c5be9d4320ef49a009ca8
diff --git a/server/git/clone_manager.go b/server/git/clone_manager.go
index afedd65..7bc9cde 100644
--- a/server/git/clone_manager.go
+++ b/server/git/clone_manager.go
@@ -12,10 +12,10 @@
 // CloneManager manages separate Git repository clones for each agent
 // This eliminates Git concurrency issues by giving each agent its own working directory
 type CloneManager struct {
-	baseRepoURL    string
-	workspacePath  string
-	agentClones    map[string]string // agent name -> clone path
-	mu             sync.RWMutex
+	baseRepoURL   string
+	workspacePath string
+	agentClones   map[string]string // agent name -> clone path
+	mu            sync.RWMutex
 }
 
 // NewCloneManager creates a new CloneManager
@@ -45,7 +45,7 @@
 
 	// Create new clone for the agent
 	clonePath := filepath.Join(cm.workspacePath, fmt.Sprintf("agent-%s", agentName))
-	
+
 	// Ensure workspace directory exists
 	if err := os.MkdirAll(cm.workspacePath, 0755); err != nil {
 		return "", fmt.Errorf("failed to create workspace directory: %w", err)
@@ -63,14 +63,14 @@
 
 	// Store the clone path
 	cm.agentClones[agentName] = clonePath
-	
+
 	return clonePath, nil
 }
 
 // cloneRepository performs the actual Git clone operation
 func (cm *CloneManager) cloneRepository(clonePath string) error {
 	ctx := context.Background()
-	
+
 	// Clone the repository
 	cmd := exec.CommandContext(ctx, "git", "clone", cm.baseRepoURL, clonePath)
 	if err := cmd.Run(); err != nil {
@@ -91,7 +91,7 @@
 	}
 
 	ctx := context.Background()
-	
+
 	// Change to clone directory and pull latest changes
 	cmd := exec.CommandContext(ctx, "git", "-C", clonePath, "pull", "origin")
 	if err := cmd.Run(); err != nil {
@@ -118,7 +118,7 @@
 
 	// Remove from tracking
 	delete(cm.agentClones, agentName)
-	
+
 	return nil
 }
 
@@ -128,7 +128,7 @@
 	defer cm.mu.Unlock()
 
 	var errors []error
-	
+
 	for agentName, clonePath := range cm.agentClones {
 		if err := os.RemoveAll(clonePath); err != nil {
 			errors = append(errors, fmt.Errorf("failed to remove clone for agent %s: %w", agentName, err))
@@ -155,6 +155,6 @@
 	for agent, path := range cm.agentClones {
 		result[agent] = path
 	}
-	
+
 	return result
-}
\ No newline at end of file
+}
diff --git a/server/git/mutex.go b/server/git/mutex.go
deleted file mode 100644
index 21bc25f..0000000
--- a/server/git/mutex.go
+++ /dev/null
@@ -1,40 +0,0 @@
-package git
-
-import (
-	"sync"
-)
-
-// GitMutex provides thread-safe access to Git operations
-// Since Git is not thread-safe, we need to serialize all Git operations
-// across all agents to prevent repository corruption and race conditions
-type GitMutex struct {
-	mu sync.Mutex
-}
-
-// NewGitMutex creates a new GitMutex instance
-func NewGitMutex() *GitMutex {
-	return &GitMutex{}
-}
-
-// Lock acquires the Git operation lock
-// This ensures only one agent can perform Git operations at a time
-func (gm *GitMutex) Lock() {
-	gm.mu.Lock()
-}
-
-// Unlock releases the Git operation lock
-func (gm *GitMutex) Unlock() {
-	gm.mu.Unlock()
-}
-
-// WithLock executes a function while holding the Git lock
-// This is a convenience method to ensure proper lock/unlock pattern
-func (gm *GitMutex) WithLock(fn func() error) error {
-	gm.Lock()
-	defer gm.Unlock()
-	return fn()
-}
-
-// Global Git mutex instance - shared across all agents
-// This ensures no concurrent Git operations across the entire application
-var GlobalGitMutex = NewGitMutex()
\ No newline at end of file