Compare commits

...

1 Commits

Author SHA1 Message Date
Michael Suchacz 434f28b09e ai workspace limit is now flat limited 2025-10-29 00:37:36 +00:00
2 changed files with 10 additions and 10 deletions
+3 -3
View File
@@ -340,7 +340,7 @@ func LicensesEntitlements(
})
// Temporary: If the license doesn't have a managed agent limit,
// we add a default of 800 managed agents per user.
// we add a default flat limit per deployment.
// This only applies to "Premium" licenses.
if claims.FeatureSet == codersdk.FeatureSetPremium {
var (
@@ -350,8 +350,8 @@ func LicensesEntitlements(
// trump this default entitlement, even if they are set to a
// smaller value.
issueTime = time.Date(2025, 7, 1, 0, 0, 0, 0, time.UTC)
defaultSoftAgentLimit = 800 * featureValue
defaultHardAgentLimit = 1000 * featureValue
defaultSoftAgentLimit = int64(800)
defaultHardAgentLimit = int64(1000)
)
entitlements.AddFeature(codersdk.FeatureManagedAgentLimit, codersdk.Feature{
Enabled: true,
+7 -7
View File
@@ -520,8 +520,8 @@ func TestEntitlements(t *testing.T) {
t.Run("Premium", func(t *testing.T) {
t.Parallel()
const userLimit = 1
const expectedAgentSoftLimit = 800 * userLimit
const expectedAgentHardLimit = 1000 * userLimit
const expectedAgentSoftLimit = 800
const expectedAgentHardLimit = 1000
db, _ := dbtestutil.NewDB(t)
licenseOptions := coderdenttest.LicenseOptions{
@@ -1495,15 +1495,15 @@ func TestManagedAgentLimitDefault(t *testing.T) {
require.Nil(t, feature.UsagePeriod)
})
// "Premium" licenses should receive a default managed agent limit of:
// soft = 800 * user_limit
// hard = 1000 * user_limit
// "Premium" licenses should receive a default flat managed agent limit per deployment:
// soft = 800
// hard = 1000
t.Run("Premium", func(t *testing.T) {
t.Parallel()
const userLimit = 100
const softLimit = 800 * userLimit
const hardLimit = 1000 * userLimit
const softLimit = 800
const hardLimit = 1000
lic := database.License{
ID: 1,
UploadedAt: time.Now(),