Skip to content

feat: add workspace max active requests limit#37527

Open
zyqzyq wants to merge 2 commits into
langgenius:mainfrom
zyqzyq:feat/workspace-max-active-requests
Open

feat: add workspace max active requests limit#37527
zyqzyq wants to merge 2 commits into
langgenius:mainfrom
zyqzyq:feat/workspace-max-active-requests

Conversation

@zyqzyq

@zyqzyq zyqzyq commented Jun 16, 2026

Copy link
Copy Markdown

Summary

Fixes #37507

This PR adds a workspace-level maximum active requests limit.

Changes included:

  • Adds max_active_requests to tenants with an Alembic migration.
  • Adds a workspace settings API for admins/owners to update the workspace name and max active requests limit.
  • Applies both workspace-level and app-level active request limits during app generation.
  • Introduces RateLimitLease to ensure multiple acquired rate limits are released consistently for blocking responses, streaming responses, and error paths.
  • Adds a new Usage & Limits page under account settings to configure the workspace active request limit.
  • Adds backend and frontend tests for the new setting, rate limit lease behavior, and UI flow.

No external runtime dependency is required for this change.

From Codex

Screenshots

Before After
Workspace settings did not expose a workspace-level active request limit. Account settings now include a Usage & Limits tab where workspace admins/owners can configure max active requests.

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

@zyqzyq zyqzyq requested a review from a team June 16, 2026 10:06
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 16, 2026
@github-actions github-actions Bot added the web This relates to changes on the web. label Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add workspace-level max active requests limit

1 participant