feat(model): extend timeout range and raise default - #1512
Conversation
📝 WalkthroughWalkthroughThis PR consolidates timeout configuration constants across the application, replacing hardcoded timeout bounds with shared constants. The default model timeout increases from 60000ms to 600000ms, with new minimum (1000ms) and maximum (3600000ms) bounds. Updates span presenter logic, UI validation components, validation utilities, internationalization strings, and associated tests. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
test/renderer/components/ChatStatusBar.test.ts (1)
8-19: Keep the test fixture type timeout-aware.Line 1496 now asserts
timeout, butTestGenerationSettingsstill cannot model timeout values throughmodelConfig,sessionSettings, or deferred session responses. Addtimeout?: numberso future timeout override/range cases stay type-safe.♻️ Proposed test type update
type TestGenerationSettings = { systemPrompt: string temperature: number contextLength: number maxTokens: number + timeout?: number reasoning?: booleanAlso applies to: 1491-1497
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test/renderer/components/ChatStatusBar.test.ts` around lines 8 - 19, The TestGenerationSettings type used in tests is missing a timeout field used by later assertions; update the TestGenerationSettings definition (the type named TestGenerationSettings) to include an optional timeout?: number so that timeout values passed via modelConfig, sessionSettings or deferred session responses are type-safe for assertions around timeout (e.g., the assertions introduced around lines asserting timeout).test/main/presenter/modelConfig.test.ts (1)
2-2: Move this suite to mirror the source path.Line 2 targets
src/main/presenter/configPresenter/modelConfig.ts, but the suite lives attest/main/presenter/modelConfig.test.ts. Please move it totest/main/presenter/configPresenter/modelConfig.test.tsand update relative imports accordingly. As per coding guidelines, “Vitest test suites should mirror the source structure undertest/main/**andtest/renderer/**.”🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test/main/presenter/modelConfig.test.ts` at line 2, The test suite file modelConfig.test.ts is placed in the wrong directory; move the test so its directory structure mirrors the source module configPresenter/modelConfig.ts under the test/main tree, and then update the import of ModelConfigHelper in the moved test to use the correct relative path to the source module (adjust the import string for ModelConfigHelper accordingly) so the test imports the actual configPresenter/modelConfig module.test/main/shared/generationSettingsValidation.test.ts (1)
1-3: Move this test under the mirroredutilspath.This file tests
src/shared/utils/generationSettingsValidation.ts, so the mirrored test path should betest/main/shared/utils/generationSettingsValidation.test.ts. As per coding guidelines,Vitest test suites should mirror the source structure under test/main/** and test/renderer/**.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test/main/shared/generationSettingsValidation.test.ts` around lines 1 - 3, The test file generationSettingsValidation.test.ts that exercises validateGenerationNumericField and imports MODEL_TIMEOUT_MAX_MS and MODEL_TIMEOUT_MIN_MS needs to be moved so its test path mirrors the source utils location (place it under the utils test directory), update any relative import paths inside the moved file so the imports for validateGenerationNumericField and the MODEL_TIMEOUT_* constants resolve correctly, and run the test suite to confirm no import failures.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@test/main/presenter/modelConfig.test.ts`:
- Line 2: The test suite file modelConfig.test.ts is placed in the wrong
directory; move the test so its directory structure mirrors the source module
configPresenter/modelConfig.ts under the test/main tree, and then update the
import of ModelConfigHelper in the moved test to use the correct relative path
to the source module (adjust the import string for ModelConfigHelper
accordingly) so the test imports the actual configPresenter/modelConfig module.
In `@test/main/shared/generationSettingsValidation.test.ts`:
- Around line 1-3: The test file generationSettingsValidation.test.ts that
exercises validateGenerationNumericField and imports MODEL_TIMEOUT_MAX_MS and
MODEL_TIMEOUT_MIN_MS needs to be moved so its test path mirrors the source utils
location (place it under the utils test directory), update any relative import
paths inside the moved file so the imports for validateGenerationNumericField
and the MODEL_TIMEOUT_* constants resolve correctly, and run the test suite to
confirm no import failures.
In `@test/renderer/components/ChatStatusBar.test.ts`:
- Around line 8-19: The TestGenerationSettings type used in tests is missing a
timeout field used by later assertions; update the TestGenerationSettings
definition (the type named TestGenerationSettings) to include an optional
timeout?: number so that timeout values passed via modelConfig, sessionSettings
or deferred session responses are type-safe for assertions around timeout (e.g.,
the assertions introduced around lines asserting timeout).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 27a7ebe8-dc3d-4443-9d22-1495251d3a30
📒 Files selected for processing (21)
src/main/presenter/agentRuntimePresenter/index.tssrc/renderer/src/components/chat/ChatStatusBar.vuesrc/renderer/src/components/settings/ModelConfigDialog.vuesrc/renderer/src/i18n/da-DK/settings.jsonsrc/renderer/src/i18n/en-US/settings.jsonsrc/renderer/src/i18n/fa-IR/settings.jsonsrc/renderer/src/i18n/fr-FR/settings.jsonsrc/renderer/src/i18n/he-IL/settings.jsonsrc/renderer/src/i18n/ja-JP/settings.jsonsrc/renderer/src/i18n/ko-KR/settings.jsonsrc/renderer/src/i18n/pt-BR/settings.jsonsrc/renderer/src/i18n/ru-RU/settings.jsonsrc/renderer/src/i18n/zh-CN/settings.jsonsrc/renderer/src/i18n/zh-HK/settings.jsonsrc/renderer/src/i18n/zh-TW/settings.jsonsrc/shared/modelConfigDefaults.tssrc/shared/utils/generationSettingsValidation.tstest/main/presenter/agentRuntimePresenter/agentRuntimePresenter.test.tstest/main/presenter/modelConfig.test.tstest/main/shared/generationSettingsValidation.test.tstest/renderer/components/ChatStatusBar.test.ts
feat(model): extend timeout range and raise default
Summary by CodeRabbit