@@ -466,7 +466,12 @@ func scanAndCleanRagcodeDirs(home string, registryRoots []string) {
466466 return nil
467467 }
468468 rel , _ := filepath .Rel (root , path )
469- if strings .Count (rel , string (os .PathSeparator )) > maxDepth {
469+
470+ depth := 0
471+ if rel != "." {
472+ depth = strings .Count (rel , string (os .PathSeparator )) + 1
473+ }
474+ if depth > maxDepth {
470475 return filepath .SkipDir
471476 }
472477 if info .IsDir () {
@@ -617,7 +622,8 @@ func detectIDEProjectParents(home string) []string {
617622 continue
618623 }
619624 // config file's parent dir (the IDE data dir, e.g. ~/.cursor)
620- addProject (filepath .Dir (ide .path ))
625+ dataDir := filepath .Dir (ide .path )
626+ addProject (filepath .Join (dataDir , ".ragcode-ide-sentinel" ))
621627 }
622628
623629 return parents
@@ -641,7 +647,7 @@ func extractWorkspaceRootsFromQdrant() []string {
641647 conn .Close ()
642648
643649 // List all collections.
644- cmd := exec .Command ("curl" , "-s" , qdrantAddr + "/collections" )
650+ cmd := exec .Command ("curl" , "-s" , "--max-time" , "5" , "--connect-timeout" , "2" , qdrantAddr + "/collections" )
645651 output , err := cmd .Output ()
646652 if err != nil {
647653 return nil
@@ -668,7 +674,7 @@ func extractWorkspaceRootsFromQdrant() []string {
668674
669675 // Scroll 1 point with payload to get a file_path sample.
670676 scrollPayload := `{"limit":1,"with_payload":true,"with_vector":false}`
671- scrollCmd := exec .Command ("curl" , "-s" , "-X" , "POST" ,
677+ scrollCmd := exec .Command ("curl" , "-s" , "--max-time" , "5" , "--connect-timeout" , "2" , "- X" , "POST" ,
672678 qdrantAddr + "/collections/" + col .Name + "/points/scroll" ,
673679 "-H" , "Content-Type: application/json" ,
674680 "-d" , scrollPayload )
@@ -738,7 +744,7 @@ func cleanQdrantCollections() {
738744 }
739745 conn .Close ()
740746
741- cmd := exec .Command ("curl" , "-s" , "http://localhost:6333/collections" )
747+ cmd := exec .Command ("curl" , "-s" , "--max-time" , "5" , "--connect-timeout" , "2" , " http://localhost:6333/collections" )
742748 output , err := cmd .Output ()
743749 if err != nil {
744750 warnMsg ("Could not list Qdrant collections: " + err .Error ())
@@ -760,7 +766,7 @@ func cleanQdrantCollections() {
760766 deleted := 0
761767 for _ , col := range resp .Result .Collections {
762768 if strings .HasPrefix (col .Name , "ragcode-" ) {
763- delCmd := exec .Command ("curl" , "-s" , "-X" , "DELETE" , "http://localhost:6333/collections/" + col .Name )
769+ delCmd := exec .Command ("curl" , "-s" , "--max-time" , "5" , "--connect-timeout" , "2" , "- X" , "DELETE" , "http://localhost:6333/collections/" + col .Name )
764770 if err := delCmd .Run (); err != nil {
765771 warnMsg ("Failed to delete collection " + col .Name + ": " + err .Error ())
766772 } else {
0 commit comments