You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: address round-7 review findings on runtime hours entitlements
measureUsage now owns the whole usage-failure policy: the cause is logged
there instead of in each Entitlements closure, so the abort rule and the
log-suppression rule can no longer drift apart (CRF-119), and the closures
are reduced to plain queries, removing the duplicated logging rationale
(CRF-116). Comment ownership is consolidated: the classifier story lives on
the codersdk warning-text constants, the tolerate-and-warn rationale on
decodeAgentRuntimeHours, and the unit rationale on agentRuntimeMsToHours,
with pointers elsewhere (CRF-116, CRF-121). The claims-ignored warning dedup
guard is pinned by a two-license test asserting one warning and per-license
log detail (CRF-117), the AI Governance near-limit branch of isMutedWarning
is pinned by its own story (CRF-118, verified by branch-local mutation), the
four usage-failure subtests share a fixture helper (CRF-123), the migration
comment now assigns SUM protection to uniqueness and attribution protection
to the alignment CHECK (CRF-120), the test-local cutPrefix is renamed
templatePrefix to stop colliding with strings.CutPrefix (CRF-122), and
formatLicenseMessage's doc states its %d-only substitution rule (CRF-124).
// either AI Governance prefix to suppress the banner's client-side
33
+
// over-limit fallback). See TestLicenseAgentRuntimeHoursWarningTexts.
33
34
LicenseAgentRuntimeHoursSoftLimitWarningText="Your deployment is approaching its Coder Agent runtime hours allocation: %d of the %d hours included in the current license term are used, at or above the advisory soft limit of %d hours."
34
35
// LicenseAgentRuntimeHoursAllocationReachedWarningText is emitted once
35
36
// the deployment reaches its runtime hour allocation. Both placeholders
@@ -38,7 +39,7 @@ const (
38
39
LicenseAgentRuntimeHoursAllocationReachedWarningText="Your deployment has used %d of the %d Coder Agent runtime hours included in the current license term."
39
40
// LicenseManagedAgentUsageUnavailableErrorText is emitted when the
40
41
// managed agent usage query fails while computing entitlements. The
41
-
// cause is logged by the query closure; this stable text is served on
42
+
// cause is logged server-side; this stable text is served on
42
43
// the unauthenticated entitlements payload instead of the raw error. It
43
44
// travels in the entitlements Errors channel, hence the ErrorText name,
44
45
// so the alertable coderd_license_errors gauge keeps counting
@@ -51,15 +52,12 @@ const (
51
52
// runtime hours sibling of LicenseManagedAgentUsageUnavailableErrorText.
52
53
LicenseAgentRuntimeUsageUnavailableErrorText="Unable to determine Coder Agent runtime usage. Reported runtime hours are unavailable until the next successful refresh; workspaces are unaffected. Check the coderd logs for details."
53
54
// LicenseAgentRuntimeHoursClaimsIgnoredWarningText is emitted when a
54
-
// license carries Coder Agent runtime hour claims that cannot be used,
55
-
// including claims that do not fit together (for example a soft limit
56
-
// at or above the allocation, or a threshold without an allocation) and
57
-
// the feature name itself minted as a claim. The unusable claims are
58
-
// ignored rather than invalidating the signed license, so without this
59
-
// warning an incorrectly issued license would be undetectable from the
60
-
// deployment. The coderd logs name the license and the dropped claims.
61
-
// The dashboard recognizes the exact text and renders it as a muted
62
-
// diagnostic without a sales link.
55
+
// license carries Coder Agent runtime hour claims that cannot be used;
56
+
// decodeAgentRuntimeHours in enterprise/coderd/license owns which claims
57
+
// are dropped and why dropping beats invalidating the license. The
58
+
// coderd logs name the license and the dropped claims. The dashboard
59
+
// recognizes the exact text and renders it as a muted diagnostic without
60
+
// a sales link.
63
61
LicenseAgentRuntimeHoursClaimsIgnoredWarningText="A license contains unusable Coder Agent runtime hour claims, which were ignored. The rest of that license is unaffected. Check the coderd logs for the affected license and claims, and contact support to have the license re-issued."
0 commit comments