fix: correct hasAITaskResources logic for child modules (#18542)

This commit is contained in:
Hugo Dutka
2025-06-24 19:14:44 +02:00
committed by GitHub
parent b2009b2a86
commit b6c493d0dc
+3 -1
View File
@@ -178,7 +178,9 @@ func hasAITaskResources(graph *gographviz.Graph) bool {
// Check if this node is a coder_ai_task resource
if label, exists := node.Attrs["label"]; exists {
labelValue := strings.Trim(label, `"`)
if strings.HasPrefix(labelValue, "coder_ai_task.") {
// The first condition is for the case where the resource is in the root module.
// The second condition is for the case where the resource is in a child module.
if strings.HasPrefix(labelValue, "coder_ai_task.") || strings.Contains(labelValue, ".coder_ai_task.") {
return true
}
}