Open source AI coding agent. Designed for large projects and real world tasks.
Go aiai-agentsai-developer-toolsai-toolsclicommand-linedeveloper-toolsgitgolanggpt-4llmopenaipolyglot-programmingterminalterminal-basedterminal-ui
add logging to file map handler
Dane Schneider39663e8f66ea
diff --git a/app/server/handlers/file_maps.go b/app/server/handlers/file_maps.goindex 2777560f..f92e017c 100644--- a/app/server/handlers/file_maps.go+++ b/app/server/handlers/file_maps.go@@ -20,6 +20,7 @@ func GetFileMapHandler(w http.ResponseWriter, r *http.Request) {auth := Authenticate(w, r, true)if auth == nil {+ log.Println("GetFileMapHandler: auth failed")return}@@ -29,6 +30,8 @@ func GetFileMapHandler(w http.ResponseWriter, r *http.Request) {return}+ log.Println("GetFileMapHandler checking server resources")+maps := make(shared.FileMapBodies)// Use half of available CPUs@@ -43,6 +46,8 @@ func GetFileMapHandler(w http.ResponseWriter, r *http.Request) {wg := sync.WaitGroup{}var mu sync.Mutex+ log.Printf("GetFileMapHandler: len(req.MapInputs): %d", len(req.MapInputs))+for path, input := range req.MapInputs {if !shared.HasFileMapSupport(path) {mu.Lock()@@ -69,6 +74,8 @@ func GetFileMapHandler(w http.ResponseWriter, r *http.Request) {}wg.Wait()+ log.Printf("GetFileMapHandler: len(maps): %d", len(maps))+resp := shared.GetFileMapResponse{MapBodies: maps,}@@ -79,6 +86,8 @@ func GetFileMapHandler(w http.ResponseWriter, r *http.Request) {return}+ log.Printf("GetFileMapHandler success - writing response bytes: %d", len(respBytes))+w.Header().Set("Content-Type", "application/json")w.Write(respBytes)}