stack/apps
Armaan Jain d78405d7e7
Gate usage limit banners behind HEXCLAVE_DISABLE_PLAN_LIMITS (#1728)
## Summary

Threads `arePlanLimitsEnforced()` from the backend through the
plan-usage API response so the dashboard can hide all usage limit
banners when `HEXCLAVE_DISABLE_PLAN_LIMITS=true`.

Backend adds `are_plan_limits_enforced` to `planUsageResponseSchema`
(`.optional().default(true)` for backward compat with older backends) →
SDK surfaces it as `PlanUsage.arePlanLimitsEnforced` with `?? true`
runtime fallback (since `getPlanUsage()` returns raw JSON without yup
validation) → banner components early-return `null` when
`!arePlanLimitsEnforced`.

For the projects page (outside admin-app context, no project selected),
a server action reads the env var directly via
`getEnvVariable(\"STACK_DISABLE_PLAN_LIMITS\", \"false\")`.

Link to Devin session:
https://app.devin.ai/sessions/09ca53f13c294c8e98c7a7227a52217d
Requested by: @Developing-Gamer

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added support for a “plan limits enforced” flag to control messaging
across usage and billing-related screens.
* Projects and team invitation capacity checks now respect the same
enforcement toggle (including admin-seat invitation blocking).

* **Bug Fixes**
* Limit banners and “plan limit exceeded” alerts now only render when
enforcement is enabled (and overage/threshold conditions are met).
* Updated usage payload handling to default to enforcement enabled when
the flag is missing; added/updated tests for both enabled and disabled
scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: armaan <armaan@stack-auth.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-07-05 21:17:21 -07:00
..
backend Gate usage limit banners behind HEXCLAVE_DISABLE_PLAN_LIMITS (#1728) 2026-07-05 21:17:21 -07:00
bulldozer-js chore: update package versions 2026-07-06 03:17:30 +00:00
dashboard Gate usage limit banners behind HEXCLAVE_DISABLE_PLAN_LIMITS (#1728) 2026-07-05 21:17:21 -07:00
dev-launchpad chore: update package versions 2026-07-06 03:17:30 +00:00
e2e chore: update package versions 2026-07-06 03:17:30 +00:00
hosted-components chore: update package versions 2026-07-06 03:17:30 +00:00
internal-tool chore: update package versions 2026-07-06 03:17:30 +00:00
mcp chore: update package versions 2026-07-06 03:17:30 +00:00
mock-oauth-server chore: update package versions 2026-07-06 03:17:30 +00:00
oauth-mock-server In-source unit tests (#429) 2025-02-14 11:47:52 -08:00
skills chore: update package versions 2026-07-06 03:17:30 +00:00