mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-21 15:33:45 +00:00
⛴️ fix: Keep MCP App and Speech Limits in One E2E Config
(cherry picked from commit e20558b736)
Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16457
This commit is contained in:
parent
ca8fb372e7
commit
04461d4cdb
4 changed files with 25 additions and 10 deletions
|
|
@ -86,11 +86,11 @@ const TwoFactorScreen: React.FC = React.memo(() => {
|
|||
return (
|
||||
<div className="mt-4">
|
||||
<form onSubmit={handleSubmit(onSubmit)}>
|
||||
<Label className="flex justify-center break-keep text-center text-sm text-text-primary">
|
||||
<Label className="text-text-primary flex justify-center text-center text-sm break-keep">
|
||||
{localize('com_auth_two_factor')}
|
||||
</Label>
|
||||
{!useBackup && (
|
||||
<div className="my-4 flex justify-center text-text-primary">
|
||||
<div className="text-text-primary my-4 flex justify-center">
|
||||
<Controller
|
||||
name="token"
|
||||
control={control}
|
||||
|
|
@ -117,12 +117,12 @@ const TwoFactorScreen: React.FC = React.memo(() => {
|
|||
)}
|
||||
/>
|
||||
{errors.token && (
|
||||
<span className="text-sm text-text-destructive">{errors.token.message}</span>
|
||||
<span className="text-text-destructive text-sm">{errors.token.message}</span>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{useBackup && (
|
||||
<div className="my-4 flex justify-center text-text-primary">
|
||||
<div className="text-text-primary my-4 flex justify-center">
|
||||
<Controller
|
||||
name="backupCode"
|
||||
control={control}
|
||||
|
|
@ -148,7 +148,7 @@ const TwoFactorScreen: React.FC = React.memo(() => {
|
|||
)}
|
||||
/>
|
||||
{errors.backupCode && (
|
||||
<span className="text-sm text-text-destructive">{errors.backupCode.message}</span>
|
||||
<span className="text-text-destructive text-sm">{errors.backupCode.message}</span>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
|
@ -169,7 +169,7 @@ const TwoFactorScreen: React.FC = React.memo(() => {
|
|||
type="button"
|
||||
variant="link"
|
||||
onClick={toggleBackupOn}
|
||||
className="inline-flex p-1 text-sm font-medium text-accent-primary transition-colors hover:text-accent-primary-hover"
|
||||
className="text-accent-primary hover:text-accent-primary-hover inline-flex p-1 text-sm font-medium transition-colors"
|
||||
>
|
||||
{localize('com_ui_use_backup_code')}
|
||||
</Button>
|
||||
|
|
@ -178,7 +178,7 @@ const TwoFactorScreen: React.FC = React.memo(() => {
|
|||
type="button"
|
||||
variant="link"
|
||||
onClick={toggleBackupOff}
|
||||
className="inline-flex p-1 text-sm font-medium text-accent-primary transition-colors hover:text-accent-primary-hover"
|
||||
className="text-accent-primary hover:text-accent-primary-hover inline-flex p-1 text-sm font-medium transition-colors"
|
||||
>
|
||||
{localize('com_ui_use_2fa_code')}
|
||||
</Button>
|
||||
|
|
|
|||
|
|
@ -32,6 +32,16 @@ memory:
|
|||
personalize: true
|
||||
tokenLimit: 10000
|
||||
|
||||
# Budgets that exist only here, not in the environment, so
|
||||
# yaml-rate-limits.spec.ts proves librechat.yaml reaches the limiters that route
|
||||
# modules build while loading. No other spec calls the speech routes.
|
||||
rateLimits:
|
||||
stt:
|
||||
userMax: 2
|
||||
tts:
|
||||
userMax: 2
|
||||
# __E2E_MCP_APP_RATE_LIMITS__
|
||||
|
||||
# __E2E_MCP_APP_SANDBOX__
|
||||
|
||||
mcpSettings:
|
||||
|
|
@ -81,8 +91,6 @@ mcpServers:
|
|||
# __E2E_DYNAMIC_MCP_NETWORK_SERVERS__
|
||||
# __E2E_MCP_APPS_SERVER__
|
||||
|
||||
# __E2E_MCP_APP_RATE_LIMITS__
|
||||
|
||||
# Per-endpoint file upload config so both upload UXs get e2e coverage:
|
||||
# - Mock Provider A keeps the legacy 3-way dropdown (chat.spec.ts exercises
|
||||
# "Upload to Provider"); legacyFileUploadUX also forces llmDeliveryPath
|
||||
|
|
|
|||
|
|
@ -304,7 +304,6 @@ function writeRuntimeMockConfig() {
|
|||
const mcpAppsRateLimits =
|
||||
mcpAppResourceLimit != null && mcpAppToolCallLimit != null
|
||||
? [
|
||||
'rateLimits:',
|
||||
' mcpApps:',
|
||||
` resourcesPerMinute: ${mcpAppResourceLimit}`,
|
||||
` toolCallsPerMinute: ${mcpAppToolCallLimit}`,
|
||||
|
|
|
|||
|
|
@ -1049,6 +1049,14 @@ test.describe('MCP Apps full integration', () => {
|
|||
test('enforces independent configured resource and tool-call quotas', async ({ page }) => {
|
||||
test.skip(PHASE !== 'quota');
|
||||
test.setTimeout(90_000);
|
||||
const config = fs.readFileSync(
|
||||
path.resolve(process.cwd(), 'e2e/.generated/librechat.e2e.yaml'),
|
||||
'utf8',
|
||||
);
|
||||
expect(config.match(/^rateLimits:/gm)).toHaveLength(1);
|
||||
expect(config).toContain(
|
||||
'rateLimits:\n stt:\n userMax: 2\n tts:\n userMax: 2\n mcpApps:\n resourcesPerMinute: 2\n toolCallsPerMinute: 2',
|
||||
);
|
||||
await resetEvents(page);
|
||||
await page.goto(NEW_CHAT_PATH, { timeout: 15_000 });
|
||||
const token = await getAccessToken(page);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue