Skip to content

improvement(concurrency): limits configurable, docs updates#5640

Merged
icecrasher321 merged 3 commits into
stagingfrom
imrpovement/concurrency-limits
Jul 13, 2026
Merged

improvement(concurrency): limits configurable, docs updates#5640
icecrasher321 merged 3 commits into
stagingfrom
imrpovement/concurrency-limits

Conversation

@icecrasher321

@icecrasher321 icecrasher321 commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Make concurrency limits configurable with env vars. Enterprise metadata supports custom limits by plan.

No limits for self hosted env vars. Update the docs.

Type of Change

  • Documentation
  • Other: Dev improvment

Testing

Tested on Staging.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jul 13, 2026 8:09pm

Request Review

@cursor

cursor Bot commented Jul 13, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes admission concurrency caps, billing attribution, Enterprise Stripe provisioning, and default unlimited behavior on self-hosted installs—areas that affect whether runs are admitted, timed out, or retained.

Overview
Execution concurrency is now a first-class, configurable limit: hosted defaults are 10 / 50 / 200 / 1,000 (free / Pro / Max / Enterprise), overridable via BILLING_CONCURRENCY_LIMIT_* and wired through Redis usage reservation instead of hardcoded caps. Enterprise can set concurrencyLimit in subscription metadata (admin dashboard issue/limits APIs); attribution and admission forward that override into reserveExecutionSlot.

Plan limit bucketing is aligned with paid tiers: Pro and Pro for Teams share Pro limits; Max and Max for Teams share Max limits (getPlanTypeForLimits), affecting concurrency, storage, rate limits, and timeouts.

Self-hosted / billing disabled: rate limits, sync/async timeouts, tables, storage, and retention cleanup dispatch are off by default; each cap can be re-enabled by explicitly setting the corresponding free-tier env var (documented in self-hosting docs, .env.example, and Helm defaults for chart installs).

Enterprise provisioning gains optional pausePaymentCollection (draft invoice freeze + indefinite keep_as_draft), concurrency on Stripe metadata sync (including unset via empty string), and related admin contract/view fields.

Upgrade comparison/plan copy and platform cost docs add a Concurrent Executions section; MCP tool execution treats zero timeout as unlimited when billing is disabled.

Reviewed by Cursor Bugbot for commit 791fbfb. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR makes billing limits configurable and updates Enterprise limit handling. The main changes are:

  • Added configurable concurrency defaults and Enterprise overrides.
  • Updated usage admission, rate, timeout, table, and storage limit behavior for billing-disabled deployments.
  • Extended Enterprise admin and Stripe provisioning metadata.
  • Updated MCP execution timeout handling and public billing docs.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
apps/sim/lib/billing/concurrency-defaults.ts Adds shared concurrency defaults and parsing bounds for billing plans.
apps/sim/lib/billing/concurrency-limits.ts Resolves plan concurrency limits from deployment settings and Enterprise metadata.
apps/sim/lib/billing/calculations/usage-reservation.ts Uses the new concurrency resolver when reserving execution slots.
apps/sim/lib/billing/enterprise-provisioning.ts Adds Enterprise concurrency metadata and optional paused collection setup.
apps/sim/lib/admin/dashboard.ts Adds Enterprise concurrency limits to dashboard summaries and updates.
apps/sim/app/api/mcp/tools/execute/route.ts Treats a zero execution timeout as no timeout for MCP tool execution.

Reviews (2): Last reviewed commit: "limits self hosted vars" | Re-trigger Greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 791fbfb. Configure here.

@icecrasher321 icecrasher321 merged commit 2d41360 into staging Jul 13, 2026
19 checks passed
@icecrasher321 icecrasher321 deleted the imrpovement/concurrency-limits branch July 13, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant