Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: convert soft_limit to limit (cherry-pick/v2.30)#22209

Merged
f0ssel merged 3 commits intorelease/2.30from
jakehwll/2.30-patch-remove-workspace-build-limit
Feb 23, 2026
Merged

feat: convert soft_limit to limit (cherry-pick/v2.30)#22209
f0ssel merged 3 commits intorelease/2.30from
jakehwll/2.30-patch-remove-workspace-build-limit

Conversation

@jakehwll
Copy link
Contributor

@jakehwll jakehwll commented Feb 20, 2026

Copy link
Member

@deansheather deansheather left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jakehwll jakehwll marked this pull request as ready for review February 20, 2026 05:56
@jakehwll jakehwll added the cherry-pick/v2.30 Needs to be cherry-picked to the 2.30 release branch label Feb 20, 2026
@coder-tasks
Copy link
Contributor

coder-tasks bot commented Feb 20, 2026

Documentation Check

No Changes Needed

This PR is a cherry-pick of #22048 and #21998 that converts the soft_limit field to a single limit field for the managed agent limit feature, and makes agent limits advisory (no longer blocking workspace builds).

The API reference docs (docs/reference/api/enterprise.md and docs/reference/api/schemas.md) are already updated in this PR to remove soft_limit from the schema examples and property tables.

The behavioral change — limits are advisory only and will not block builds — is already accurately documented in docs/ai-coder/ai-governance.md (lines 143–144):

Coder Tasks and other AI features continue to function normally even if the limit is breached. Admins will receive a warning to contact their account team to remediate.

No additional documentation updates are needed.


Automated review via Coder Tasks

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 |
@jakehwll jakehwll force-pushed the jakehwll/2.30-patch-remove-workspace-build-limit branch from 3b189b9 to 611b143 Compare February 23, 2026 13:22
@coder-tasks
Copy link
Contributor

coder-tasks bot commented Feb 23, 2026

Documentation Check

Previous Feedback

Partially 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

  • docs/images/admin/ai-governance-awb-usage.png — The Licenses page progress bar UI has changed: the separate "Limit" indicator and label are removed; only "Actual" and "Included" remain. The screenshot (added in chore: update AI governance docs for v2.30 release #21870) likely still shows the old three-value layout. Consider refreshing it to match the simplified bar.

No Changes Needed (for text/prose)

The existing prose in docs/ai-coder/ai-governance.md remains accurate:

  • Advisory-limit behavior ("continue to function normally even if the limit is breached") still holds for entitled customers over their limit.
  • The blocking scenarios added by fix: restore block to Managed Agents on Enterprise #22210 (licensed but no entitlement, or explicitly disabled) are edge cases for customers without the AI Governance Add-On; the existing doc copy handles this implicitly via the licensing tier descriptions.
  • API reference changes (docs/reference/api/enterprise.md, docs/reference/api/schemas.md) correctly remove soft_limit from schema examples and the property table.

Automated review via Coder Tasks

@f0ssel f0ssel merged commit bfb6583 into release/2.30 Feb 23, 2026
28 of 30 checks passed
@f0ssel f0ssel deleted the jakehwll/2.30-patch-remove-workspace-build-limit branch February 23, 2026 22:18
@github-actions github-actions bot locked and limited conversation to collaborators Feb 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cherry-pick/v2.30 Needs to be cherry-picked to the 2.30 release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants