feat: report stable license measurement diagnostics and tolerate unusable runtime hours claims - #27984
Draft
jaaydenh wants to merge 3 commits into
Draft
feat: report stable license measurement diagnostics and tolerate unusable runtime hours claims#27984jaaydenh wants to merge 3 commits into
jaaydenh wants to merge 3 commits into
Conversation
…able runtime hours claims Two coupled changes to the license/entitlements layer. Measurement diagnostics: extract a measureUsage helper that owns the usage-query failure policy. A query failure now publishes the stable codersdk.LicenseManagedAgentUsageUnavailableErrorText on the entitlements Errors channel (keeping the alertable coderd_license_errors gauge counting) while the raw cause goes to the coderd log through the new FeatureArguments.Logger. A nil usage closure becomes a hard developer error, and a failure with a dead context still aborts the whole refresh. The managed agent count closure switches from AsSystemRestricted to the narrower AsUsagePublisher subject. The dashboard recognizes diagnostic texts and renders them muted, without the exceedance heading or a sales link. Claim tolerance: unusable agent_runtime_hours_* claim combinations no longer reject the whole license. decodeAgentRuntimeHours drops the unusable claims, reports them in a stable LicenseAgentRuntimeHoursClaimsIgnoredWarningText warning (deduplicated across licenses), and logs the affected license and claims; validateAgentRuntimeHours and its license-invalidating errors are removed. Rejecting a signed license over a cosmetic threshold claim would drop the deployment to unlicensed. Part of the stack for #27796.
This was referenced Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two coupled changes to the license/entitlements layer, preparing for runtime-hours usage reporting.
Stable measurement diagnostics. A new
measureUsagehelper owns the usage-query failure policy: a query failure publishes the stablecodersdk.LicenseManagedAgentUsageUnavailableErrorTexton the entitlementsErrorschannel (so the alertablecoderd_license_errorsgauge keeps counting measurement failures) while the raw cause goes to the coderd log through the newFeatureArguments.Logger. A nil usage closure becomes a hard developer error, and a failure with a dead context still aborts the whole refresh instead of logging a false alarm. The managed agent count closure switches fromAsSystemRestrictedto the narrowerAsUsagePublishersubject. The dashboard recognizes diagnostic texts and renders them muted, with a "License notices" heading instead of the exceedance heading and without a sales link.Tolerate unusable runtime hour claims. Unusable
agent_runtime_hours_*claim combinations no longer reject the whole license: rejecting a signed license over a cosmetic threshold claim would drop the deployment to unlicensed.decodeAgentRuntimeHoursdrops the unusable claims, surfaces the stableLicenseAgentRuntimeHoursClaimsIgnoredWarningText(deduplicated across licenses), and logs the affected license and claims;validateAgentRuntimeHoursand its license-invalidating errors are removed.Part 2 of a 3-PR stack splitting up #27796 (see there for review history). Stack: #27983 → this PR → #27985.