internal/task: tidy x/exp and x/telemetry nested modules too

Nested modules with replace directives need to be tidied too,
else they end up in an inconsistent state and their builds fail.

Though it's tempting to automate the discovery of such modules,
it would take some code and these situations are fairly rare.
So for now add the missing ones to the hard-coded list manually;
we can change our minds about it later if we want.

For golang/go#56530.

Change-Id: Ic622d3f0080abc17410060c77978a3917f0be0b7
Reviewed-on: https://go-review.googlesource.com/c/build/+/525657
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
diff --git a/internal/task/tagx.go b/internal/task/tagx.go
index a7161e6..1b5b542 100644
--- a/internal/task/tagx.go
+++ b/internal/task/tagx.go
@@ -430,11 +430,17 @@
 		return nil, fmt.Errorf("Command failed: %v", remoteErr)
 	}
 
-	// Tidy the root module. For tools, also tidy gopls so that its replaced
-	// version still works.
-	dirs := []string{""}
-	if repo.Name == "tools" {
-		dirs = append(dirs, "gopls")
+	// Tidy the root module.
+	// Also tidy nested modules with a replace directive.
+	dirs := []string{"."}
+	switch repo.Name {
+	case "exp":
+		dirs = append(dirs, "slog/benchmarks/zap_benchmarks")     // A local replace directive as of 2023-09-05.
+		dirs = append(dirs, "slog/benchmarks/zerolog_benchmarks") // A local replace directive as of 2023-09-05.
+	case "telemetry":
+		dirs = append(dirs, "godev") // A local replace directive as of 2023-09-05.
+	case "tools":
+		dirs = append(dirs, "gopls") // A local replace directive as of 2023-09-05.
 	}
 	var fetchCmd []string
 	for _, dir := range dirs {