feat: convert soft_limit to limit (cherry-pick/v2.30)#22209
feat: convert soft_limit to limit (cherry-pick/v2.30)#22209f0ssel merged 3 commits intorelease/2.30from
soft_limit to limit (cherry-pick/v2.30)#22209Conversation
Documentation CheckNo Changes NeededThis PR is a cherry-pick of #22048 and #21998 that converts the The API reference docs ( The behavioral change — limits are advisory only and will not block builds — is already accurately documented in
No additional documentation updates are needed. Automated review via Coder Tasks |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b30ff1ab7f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| } | ||
|
|
||
| return wsbuilder.UsageCheckResponse{Permitted: true}, nil |
There was a problem hiding this comment.
Keep managed-agent entitlement enforcement in build checks
CheckBuildUsage now returns Permitted: true for every build that does not use external agents, which removes the only runtime gate that previously rejected AI-task builds when managed_agent_limit was not entitled (missing/disabled/zero). Because wsbuilder.Builder.checkUsage relies on this response to allow the build, licensed deployments without managed-agent entitlement can now create managed-agent workspaces anyway, effectively bypassing license enforcement instead of only making over-limit usage advisory.
Useful? React with 👍 / 👎.
In relation to [`internal#1281`](coder/internal#1281) Managed agent workspace build limits are now advisory only. Breaching the limit no longer blocks workspace creation — it only surfaces a warning. - Removed hard-limit enforcement in `checkAIBuildUsage` so AI task builds are always permitted regardless of managed agent count. - Updated the license warning to remove "Further managed agent builds will be blocked." verbiage. - Updated tests to assert builds succeed beyond the limit instead of failing. - Removed the "Limit" display from the `ManagedAgentsConsumption` progress bar — the bar is now relative to the included allowance (soft limit) only, and turns orange when usage exceeds it. Bonus: - De-MUI'd `LicenseBannerView` — replaced Emotion CSS and MUI `Link` with Tailwind classes. - Added `highlight-orange` color token to the Tailwind theme. (cherry picked from commit 2038997)
In relation to [`internal#1281`](coder/internal#1281) Remove the `soft_limit` field from the `Feature` type and simplify license limit handling. This change: - Removes the `soft_limit` field from the API and SDK - Uses the soft limit value as the single `limit` value in the UI and API - Simplifies warning logic to only show warnings when the limit is exceeded - Updates tests to reflect the new behavior - Updates the UI to use the single limit value for display (cherry picked from commit 051ed34)
#21998 accidentally allowed `Managed Agents` usages whilst being on an `Enterprise` license. This was incorrect, it should work as the following (same as prior to #21998). | Scenario | Before your PRs | After your PRs (bug) | After this fix | |---|---|---|---| | Unlicensed (AGPL) | Permitted | Permitted | Permitted | | Licensed, no entitlement | **Blocked** | Permitted | **Blocked** | | Licensed, explicitly disabled (limit=0) | **Blocked** | Permitted | **Blocked** | | Licensed, entitled, under limit | Permitted | Permitted | Permitted | | Licensed, entitled, over limit | Blocked | Permitted (advisory) | Permitted (advisory) | | Any license, stop/delete | Permitted | Permitted | Permitted | | Any license, non-AI build | Permitted | Permitted | Permitted |
3b189b9 to
611b143
Compare
Documentation CheckPrevious FeedbackPartially addressed — the previous review covered cherry-picks #22048 and #21998. This PR now also includes #22210, which restores blocking behavior for licensed deployments without managed-agent entitlement. Updates Needed
No Changes Needed (for text/prose)The existing prose in
Automated review via Coder Tasks |
Related
internal#1281Cherry picks two pull-requests in
release/2.30.soft_limittolimit#22048Managed AgentsonEnterprise#22210