Skip to content

Commit 7e85c7c

Browse files
authored
feat(model): extend timeout range and raise default (#1512)
1 parent ba780ee commit 7e85c7c

21 files changed

Lines changed: 63 additions & 35 deletions

File tree

src/main/presenter/agentRuntimePresenter/index.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ import {
4343
validateGenerationNumericField
4444
} from '@shared/utils/generationSettingsValidation'
4545
import { resolveMoonshotKimiTemperaturePolicy } from '@shared/moonshotKimiPolicy'
46-
import { DEFAULT_MODEL_TIMEOUT } from '@shared/modelConfigDefaults'
46+
import {
47+
DEFAULT_MODEL_TIMEOUT,
48+
MODEL_TIMEOUT_MAX_MS,
49+
MODEL_TIMEOUT_MIN_MS
50+
} from '@shared/modelConfigDefaults'
4751
import { nanoid } from 'nanoid'
4852
import type { SQLitePresenter } from '../sqlitePresenter'
4953
import { eventBus, SendTarget } from '@/eventbus'
@@ -143,9 +147,6 @@ type ActiveGeneration = {
143147
}
144148

145149
const RATE_LIMIT_STREAM_MESSAGE_PREFIX = '__rate_limit__:'
146-
const SESSION_TIMEOUT_MIN_MS = 1000
147-
const SESSION_TIMEOUT_MAX_MS = 600000
148-
149150
const createAbortError = (): Error => {
150151
if (typeof DOMException !== 'undefined') {
151152
return new DOMException('Aborted', 'AbortError')
@@ -2752,7 +2753,7 @@ export class AgentRuntimePresenter implements IAgentImplementation {
27522753
0.7,
27532754
contextLength: contextLengthDefault,
27542755
timeout:
2755-
timeoutDefault >= SESSION_TIMEOUT_MIN_MS && timeoutDefault <= SESSION_TIMEOUT_MAX_MS
2756+
timeoutDefault >= MODEL_TIMEOUT_MIN_MS && timeoutDefault <= MODEL_TIMEOUT_MAX_MS
27562757
? timeoutDefault
27572758
: DEFAULT_MODEL_TIMEOUT,
27582759
maxTokens:

src/renderer/src/components/chat/ChatStatusBar.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,11 @@ import {
917917
type GenerationNumericValidationCode,
918918
validateGenerationNumericField
919919
} from '@shared/utils/generationSettingsValidation'
920-
import { DEFAULT_MODEL_TIMEOUT } from '@shared/modelConfigDefaults'
920+
import {
921+
DEFAULT_MODEL_TIMEOUT,
922+
MODEL_TIMEOUT_MAX_MS,
923+
MODEL_TIMEOUT_MIN_MS
924+
} from '@shared/modelConfigDefaults'
921925
import McpIndicator from '@/components/chat-input/McpIndicator.vue'
922926
import ModelIcon from '@/components/icons/ModelIcon.vue'
923927
import { createConfigClient } from '@api/ConfigClient'
@@ -966,8 +970,8 @@ const TEMPERATURE_STEP = 0.1
966970
const CONTEXT_LENGTH_STEP = 1024
967971
const MAX_TOKENS_STEP = 128
968972
const TIMEOUT_STEP = 1000
969-
const TIMEOUT_MIN = 1000
970-
const TIMEOUT_MAX = 600000
973+
const TIMEOUT_MIN = MODEL_TIMEOUT_MIN_MS
974+
const TIMEOUT_MAX = MODEL_TIMEOUT_MAX_MS
971975
const THINKING_BUDGET_STEP = 128
972976
const ACP_INLINE_OPTION_LIMIT = 3
973977
const DEFAULT_VERBOSITY_OPTIONS: SessionGenerationSettings['verbosity'][] = [

src/renderer/src/components/settings/ModelConfigDialog.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@
105105
v-model.number="config.timeout"
106106
type="number"
107107
step="1000"
108-
:min="1000"
109-
:max="600000"
108+
:min="MODEL_TIMEOUT_MIN_MS"
109+
:max="MODEL_TIMEOUT_MAX_MS"
110110
:placeholder="t('settings.model.modelConfig.timeout.label')"
111111
:class="{ 'border-destructive': errors.timeout }"
112112
/>
@@ -496,7 +496,9 @@ import {
496496
DEFAULT_MODEL_FUNCTION_CALL,
497497
DEFAULT_MODEL_MAX_TOKENS,
498498
DEFAULT_MODEL_TIMEOUT,
499-
DEFAULT_MODEL_VISION
499+
DEFAULT_MODEL_VISION,
500+
MODEL_TIMEOUT_MAX_MS,
501+
MODEL_TIMEOUT_MIN_MS
500502
} from '@shared/modelConfigDefaults'
501503
import { useModelConfigStore } from '@/stores/modelConfigStore'
502504
import { useModelStore } from '@/stores/modelStore'
@@ -1136,9 +1138,9 @@ const validateForm = () => {
11361138
11371139
if (config.value.timeout !== undefined && config.value.timeout !== null) {
11381140
const timeout = Number(config.value.timeout)
1139-
if (!Number.isFinite(timeout) || timeout < 1000) {
1141+
if (!Number.isFinite(timeout) || timeout < MODEL_TIMEOUT_MIN_MS) {
11401142
errors.value.timeout = t('settings.model.modelConfig.validation.timeoutMin')
1141-
} else if (timeout > 600000) {
1143+
} else if (timeout > MODEL_TIMEOUT_MAX_MS) {
11421144
errors.value.timeout = t('settings.model.modelConfig.validation.timeoutMax')
11431145
}
11441146
}

src/renderer/src/i18n/da-DK/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@
436436
"temperatureMin": "Temperaturen skal være større end eller lig 0",
437437
"temperatureRequired": "Temperaturen må ikke være tom",
438438
"timeoutMin": "Tidsgrænsen for anmodning skal være mindst 1000ms",
439-
"timeoutMax": "Tidsgrænsen for anmodning må ikke overstige 600000ms"
439+
"timeoutMax": "Tidsgrænsen for anmodning må ikke overstige 3600000ms"
440440
},
441441
"vision": {
442442
"description": "Understøtter modellen visuelle funktioner?",

src/renderer/src/i18n/en-US/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@
565565
"temperatureMin": "The temperature must be greater than or equal to 0",
566566
"temperatureRequired": "The temperature cannot be empty",
567567
"timeoutMin": "Request timeout must be at least 1000ms",
568-
"timeoutMax": "Request timeout cannot exceed 600000ms"
568+
"timeoutMax": "Request timeout cannot exceed 3600000ms"
569569
},
570570
"vision": {
571571
"description": "Does the model support visual ability?",

src/renderer/src/i18n/fa-IR/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@
503503
"temperatureMin": "دما باید بیشتر یا برابر با 0 باشد",
504504
"temperatureRequired": "درجه حرارت نمی تواند خالی باشد",
505505
"timeoutMin": "تایم‌اوت باید حداقل 1000ms باشد",
506-
"timeoutMax": "تایم‌اوت نمی‌تواند از 600000ms بیشتر باشد"
506+
"timeoutMax": "تایم‌اوت نمی‌تواند از 3600000ms بیشتر باشد"
507507
},
508508
"vision": {
509509
"description": "آیا مدل از توانایی بصری پشتیبانی می کند؟",

src/renderer/src/i18n/fr-FR/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@
503503
"temperatureMin": "La température doit être supérieure ou égale à 0",
504504
"temperatureRequired": "La température ne peut pas être vide",
505505
"timeoutMin": "Le délai d'attente doit être d'au moins 1000ms",
506-
"timeoutMax": "Le délai d'attente ne peut pas dépasser 600000ms"
506+
"timeoutMax": "Le délai d'attente ne peut pas dépasser 3600000ms"
507507
},
508508
"vision": {
509509
"description": "Le modèle soutient-il la capacité visuelle?",

src/renderer/src/i18n/he-IL/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@
503503
"temperatureMin": "הטמפרטורה חייבת להיות גדולה או שווה ל-0",
504504
"temperatureRequired": "הטמפרטורה אינה יכולה להיות ריקה",
505505
"timeoutMin": "הטיימאוט חייב להיות לפחות 1000ms",
506-
"timeoutMax": "הטיימאוט אינו יכול לעלות על 600000ms"
506+
"timeoutMax": "הטיימאוט אינו יכול לעלות על 3600000ms"
507507
},
508508
"vision": {
509509
"description": "האם המודל תומך ביכולת חזותית?",

src/renderer/src/i18n/ja-JP/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@
503503
"temperatureMin": "温度は0以上でなければなりません",
504504
"temperatureRequired": "温度を空にすることはできません",
505505
"timeoutMin": "タイムアウトは最低1000msでなければなりません",
506-
"timeoutMax": "タイムアウトは600000msを超えることはできません"
506+
"timeoutMax": "タイムアウトは3600000msを超えることはできません"
507507
},
508508
"vision": {
509509
"description": "モデルは視覚能力をサポートしていますか?",

src/renderer/src/i18n/ko-KR/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@
503503
"temperatureMin": "온도는 0보다 크거나 같아야합니다.",
504504
"temperatureRequired": "온도는 비어있을 수 없습니다",
505505
"timeoutMin": "요청 시간 초과는 최소 1000ms여야 합니다",
506-
"timeoutMax": "요청 시간 초과는 600000ms를 초과할 수 없습니다"
506+
"timeoutMax": "요청 시간 초과는 3600000ms를 초과할 수 없습니다"
507507
},
508508
"vision": {
509509
"description": "모델이 시각적 능력을 지원합니까?",

0 commit comments

Comments
 (0)