feat: add configurable queue parameters#926
Conversation
Expose hardcoded queue parameters as user-configurable options: - requestQueueConfig: timeoutMs, maxRetries, baseRetryDelayMs - batchQueueConfig: batchDelay Includes: - Zod schema updates with validation bounds (min/max) - Default values and constants (timeoutMs: 30s, maxRetries: 2, baseRetryDelayMs: 1.5s, batchDelay: 250ms) - Migration script v051-to-v052 for backward compatibility - UI updates with proper min/max validation - Translations for all 8 locales (zh-CN, zh-TW, en, ja, ko, ru, tr, vi) - BatchQueue runtime config update support BREAKING CHANGE: CONFIG_SCHEMA_VERSION bumped to 52
🦋 Changeset detectedLatest commit: 4b0855b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
6 issues found across 21 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="src/locales/ja.yml">
<violation number="1" location="src/locales/ja.yml:263">
P2: Japanese locale is missing new video subtitles queue parameter labels (timeoutMs/maxRetries/baseRetryDelayMs/batchDelay) that the subtitles settings UI now renders.</violation>
</file>
<file name="src/locales/zh-CN.yml">
<violation number="1" location="src/locales/zh-CN.yml:264">
P2: Missing zh-CN translations for new queue parameters under videoSubtitles settings if the UI exposes the same fields.</violation>
</file>
<file name="src/locales/zh-TW.yml">
<violation number="1" location="src/locales/zh-TW.yml:264">
P2: zh-TW locale is missing videoSubtitles queue parameter labels (timeoutMs/maxRetries/baseRetryDelayMs/batchDelay) even though the UI renders these keys, so subtitle settings will show fallback/missing labels.</violation>
</file>
<file name="src/utils/config/migration-scripts/v051-to-v052.ts">
<violation number="1" location="src/utils/config/migration-scripts/v051-to-v052.ts:29">
P2: Default batch queue values overwrite any existing config during migration, discarding user-provided `batchDelay` settings.</violation>
</file>
<file name="src/types/config/translate.ts">
<violation number="1" location="src/types/config/translate.ts:30">
P2: maxRetries represents a count but schema allows fractional values; retry logic compares an integer counter against this number, so decimals can yield unexpected retry counts.</violation>
</file>
<file name="src/locales/ko.yml">
<violation number="1" location="src/locales/ko.yml:264">
P2: Missing Korean i18n keys for new video subtitles queue parameters; UI now expects timeoutMs/maxRetries/baseRetryDelayMs and batchDelay labels under options.videoSubtitles.*, so Korean UI will show raw keys or blanks.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| rate: | ||
| title: 秒間平均リクエスト数 | ||
| description: 平均秒間リクエスト数(ただし、最大バーストリクエスト数を設定し一時的な超過リクエスト送信を許可) | ||
| timeoutMs: |
There was a problem hiding this comment.
P2: Japanese locale is missing new video subtitles queue parameter labels (timeoutMs/maxRetries/baseRetryDelayMs/batchDelay) that the subtitles settings UI now renders.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/locales/ja.yml, line 263:
<comment>Japanese locale is missing new video subtitles queue parameter labels (timeoutMs/maxRetries/baseRetryDelayMs/batchDelay) that the subtitles settings UI now renders.</comment>
<file context>
@@ -260,6 +260,15 @@ options:
rate:
title: 秒間平均リクエスト数
description: 平均秒間リクエスト数(ただし、最大バーストリクエスト数を設定し一時的な超過リクエスト送信を許可)
+ timeoutMs:
+ title: リクエストタイムアウト
+ description: 翻訳リクエストのタイムアウト時間(ミリ秒)。この時間を超えるとリクエストがキャンセルされ、再試行されます(再試行が有効な場合)。
</file context>
| rate: | ||
| title: 每秒平均请求数量 | ||
| description: 平均每秒的请求数量,不过允许配置最大突发请求数来短暂发送超量请求。 | ||
| timeoutMs: |
There was a problem hiding this comment.
P2: Missing zh-CN translations for new queue parameters under videoSubtitles settings if the UI exposes the same fields.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/locales/zh-CN.yml, line 264:
<comment>Missing zh-CN translations for new queue parameters under videoSubtitles settings if the UI exposes the same fields.</comment>
<file context>
@@ -261,6 +261,15 @@ options:
rate:
title: 每秒平均请求数量
description: 平均每秒的请求数量,不过允许配置最大突发请求数来短暂发送超量请求。
+ timeoutMs:
+ title: 请求超时时间
+ description: 单个翻译请求的超时时长(毫秒),超时后将取消请求并进行重试(如果启用了重试)
</file context>
| rate: | ||
| title: 每秒平均請求數量 | ||
| description: 平均每秒的請求數量,但允許設定最大突發請求數來短暫發送超量請求 | ||
| timeoutMs: |
There was a problem hiding this comment.
P2: zh-TW locale is missing videoSubtitles queue parameter labels (timeoutMs/maxRetries/baseRetryDelayMs/batchDelay) even though the UI renders these keys, so subtitle settings will show fallback/missing labels.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/locales/zh-TW.yml, line 264:
<comment>zh-TW locale is missing videoSubtitles queue parameter labels (timeoutMs/maxRetries/baseRetryDelayMs/batchDelay) even though the UI renders these keys, so subtitle settings will show fallback/missing labels.</comment>
<file context>
@@ -261,6 +261,15 @@ options:
rate:
title: 每秒平均請求數量
description: 平均每秒的請求數量,但允許設定最大突發請求數來短暫發送超量請求
+ timeoutMs:
+ title: 請求超時時間
+ description: 單個翻譯請求的超時時長(毫秒),超時後將取消請求並進行重試(如果啟用了重試)
</file context>
|
|
||
| // Helper to merge requestQueueConfig | ||
| const mergeRequestQueueConfig = (existing: any) => ({ | ||
| ...existing, |
There was a problem hiding this comment.
P2: Default batch queue values overwrite any existing config during migration, discarding user-provided batchDelay settings.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/utils/config/migration-scripts/v051-to-v052.ts, line 29:
<comment>Default batch queue values overwrite any existing config during migration, discarding user-provided `batchDelay` settings.</comment>
<file context>
@@ -0,0 +1,60 @@
+
+ // Helper to merge requestQueueConfig
+ const mergeRequestQueueConfig = (existing: any) => ({
+ ...existing,
+ ...defaultRequestQueueConfig,
+ })
</file context>
| capacity: z.number().gte(MIN_TRANSLATE_CAPACITY), | ||
| rate: z.number().gte(MIN_TRANSLATE_RATE), | ||
| timeoutMs: z.number().min(MIN_REQUEST_TIMEOUT_MS).max(MAX_REQUEST_TIMEOUT_MS), | ||
| maxRetries: z.number().min(MIN_MAX_RETRIES).max(MAX_MAX_RETRIES), |
There was a problem hiding this comment.
P2: maxRetries represents a count but schema allows fractional values; retry logic compares an integer counter against this number, so decimals can yield unexpected retry counts.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/types/config/translate.ts, line 30:
<comment>maxRetries represents a count but schema allows fractional values; retry logic compares an integer counter against this number, so decimals can yield unexpected retry counts.</comment>
<file context>
@@ -1,17 +1,40 @@
capacity: z.number().gte(MIN_TRANSLATE_CAPACITY),
rate: z.number().gte(MIN_TRANSLATE_RATE),
+ timeoutMs: z.number().min(MIN_REQUEST_TIMEOUT_MS).max(MAX_REQUEST_TIMEOUT_MS),
+ maxRetries: z.number().min(MIN_MAX_RETRIES).max(MAX_MAX_RETRIES),
+ baseRetryDelayMs: z.number().min(MIN_BASE_RETRY_DELAY_MS).max(MAX_BASE_RETRY_DELAY_MS),
})
</file context>
| maxRetries: z.number().min(MIN_MAX_RETRIES).max(MAX_MAX_RETRIES), | |
| maxRetries: z.number().int().min(MIN_MAX_RETRIES).max(MAX_MAX_RETRIES), |
| rate: | ||
| title: 초당 평균 요청 수 | ||
| description: 초당 평균 요청 수 (단, 최대 버스트 요청 수 설정을 통한 일시적 초과 요청 전송 허용) | ||
| timeoutMs: |
There was a problem hiding this comment.
P2: Missing Korean i18n keys for new video subtitles queue parameters; UI now expects timeoutMs/maxRetries/baseRetryDelayMs and batchDelay labels under options.videoSubtitles.*, so Korean UI will show raw keys or blanks.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/locales/ko.yml, line 264:
<comment>Missing Korean i18n keys for new video subtitles queue parameters; UI now expects timeoutMs/maxRetries/baseRetryDelayMs and batchDelay labels under options.videoSubtitles.*, so Korean UI will show raw keys or blanks.</comment>
<file context>
@@ -261,6 +261,15 @@ options:
rate:
title: 초당 평균 요청 수
description: 초당 평균 요청 수 (단, 최대 버스트 요청 수 설정을 통한 일시적 초과 요청 전송 허용)
+ timeoutMs:
+ title: 요청 시간 초과
+ description: 단일 번역 요청의 시간 초과 기간(밀리초)입니다. 이 시간이 지나면 요청이 취소되고 재시도됩니다(재시도가 활성화된 경우).
</file context>
|
any specific reason we need to expose these to users? I don't want to make the software too complicated |
|
Because I often encounter http 409 errors, the model service complains that the request frequency is too high, even if it is configured to request 2 times per second on average, it can only reduce this problem by increasing the number of text translated per translation and using a long timeout time.
…---Original---
From: ***@***.***>
Date: Tue, Feb 3, 2026 12:23 PM
To: ***@***.***>;
Cc: "Yrom ***@***.******@***.***>;
Subject: Re: [mengxi-ream/read-frog] feat: add configurable queue parameters(PR #926)
mengxi-ream left a comment (mengxi-ream/read-frog#926)
any specific reason we need to expose these to users? I don't want to make the software too complicated
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Have you tried to make this burst count lower?
and make these higher?
|
|
Maximum 3 burst requests, 2 per second. Max 4000 characters, 4 paragraphs. |
Are you saying that this setting won't resolve the issue because lengthy characters in a single batch may lead to a timeout? |
|
right. The request timeout needs to be increased.
…---Original---
From: ***@***.***>
Date: Tue, Feb 3, 2026 12:53 PM
To: ***@***.***>;
Cc: "Yrom ***@***.******@***.***>;
Subject: Re: [mengxi-ream/read-frog] feat: add configurable queue parameters(PR #926)
mengxi-ream left a comment (mengxi-ream/read-frog#926)
Maximum 3 burst requests, 2 per second. Max 4000 characters, 4 paragraphs.
Are you saying that this setting won't resolve the issue because lengthy characters in a single batch may lead to a timeout?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
if so, could you only export the timeout setting to users so they won't be freaking out to see so many settings. can put it here:
|
Code Review: feat: add configurable queue parametersOverall AssessmentSolid feature addition. The implementation follows the established patterns well (Zod schemas, migration scripts, UI components, i18n). The code is clean and the migration path is well-considered. Code Quality & Best PracticesStrengths:
Issues:
Security Concerns
Test Coverage
Performance Considerations
SummaryGood PR overall. The main actionable item is the |



Type of Changes
Description
Expose hardcoded queue parameters as user-configurable options:
requestQueueConfig:
timeoutMs: Request timeout (default: 30s, min: 5s, max: 120s)maxRetries: Maximum retry attempts (default: 2, min: 0, max: 5)baseRetryDelayMs: Base delay before retry (default: 1.5s, min: 0.5s, max: 10s)batchQueueConfig:
batchDelay: Delay between batch processing (default: 250ms, min: 50ms, max: 2000ms)Implementation details:
Modified files:
src/types/config/translate.tssrc/entrypoints/background/translation-queues.tssrc/utils/config/migration-scripts/v051-to-v052.tssrc/utils/config/__tests__/example/v052.tsRelated Issue
N/A
How Has This Been Tested?
Checklist
Summary by cubic
Made request and batch queue settings configurable (timeout, retries, retry delay, batch delay) for translation and video subtitles, with UI controls and validation. This gives users finer control over performance and reliability.
New Features
Migration
Written for commit 4b0855b. Summary will update on new commits.