@@ -69,27 +69,27 @@ func GetAnthropicModelFromEnv() anthropic.Model {
69
69
return anthropic .Model (os .Getenv ("ANTHROPIC_MODEL" ))
70
70
}
71
71
72
- // generateSuffix generates a random hex string between `000 ` and `fff `.
72
+ // generateSuffix generates a random hex string between `0000 ` and `ffff `.
73
73
func generateSuffix () string {
74
- numMin := 0x0000
75
- numMax := 0x1000
74
+ numMin := 0x00000
75
+ numMax := 0x10000
76
76
//nolint:gosec // We don't need a cryptographically secure random number generator for generating a task name suffix.
77
77
num := rand .IntN (numMax - numMin ) + numMin
78
78
79
- return fmt .Sprintf ("%03x " , num )
79
+ return fmt .Sprintf ("%04x " , num )
80
80
}
81
81
82
82
func GenerateFallback () string {
83
83
// We have a 32 character limit for the name.
84
84
// We have a 5 character prefix `task-`.
85
- // We have a 4 character suffix `-fff `.
86
- // This leaves us with 23 characters for the middle.
85
+ // We have a 5 character suffix `-ffff `.
86
+ // This leaves us with 22 characters for the middle.
87
87
//
88
88
// Unfortunately, `namesgenerator.GetRandomName(0)` will
89
- // generate names that are longer than 23 characters, so
89
+ // generate names that are longer than 22 characters, so
90
90
// we just trim these down to length.
91
91
name := strings .ReplaceAll (namesgenerator .GetRandomName (0 ), "_" , "-" )
92
- name = name [:min (len (name ), 23 )]
92
+ name = name [:min (len (name ), 22 )]
93
93
name = strings .TrimSuffix (name , "-" )
94
94
95
95
return fmt .Sprintf ("task-%s-%s" , name , generateSuffix ())
0 commit comments