Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: increase range of generateSuffix
  • Loading branch information
DanielleMaywood committed Aug 21, 2025
commit 74bfabc0a4bca91bcbb828ea85c2f1e277e34298
6 changes: 3 additions & 3 deletions coderd/taskname/taskname.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ func GetAnthropicModelFromEnv() anthropic.Model {
return anthropic.Model(os.Getenv("ANTHROPIC_MODEL"))
}

// generateSuffix generates a random hex string between `100` and `fff`.
// generateSuffix generates a random hex string between `000` and `fff`.
func generateSuffix() string {
numMin := 0x100
numMin := 0x0000
numMax := 0x1000
//nolint:gosec // We don't need a cryptographically secure random number generator for generating a task name suffix.
num := rand.IntN(numMax-numMin) + numMin

return fmt.Sprintf("%x", num)
return fmt.Sprintf("%03x", num)
}

func GenerateFallback() string {
Expand Down
Loading