-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat: add configurable max batch retries for scanner #10398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This PR addresses Issue #10396 by adding a user-configurable setting for the maximum number of batch retries during codebase indexing. Changes: - Add batch retry constants to CODEBASE_INDEX_DEFAULTS (min: 1, max: 10, default: 3) - Add codebaseIndexMaxBatchRetries field to config schema - Update config-manager.ts to expose currentMaxBatchRetries getter - Update scanner.ts to accept and use configurable maxBatchRetries - Update service-factory.ts to pass configured value to DirectoryScanner - Add UI slider in Advanced Settings section of CodeIndexPopover - Add i18n translation strings for the new setting
All issues resolved. The type assertion fix has been implemented and the i18n translation keys have been added to all locale files.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
| codebaseIndexSearchMaxResults, | ||
| } = codebaseIndexConfig | ||
| codebaseIndexMaxBatchRetries, | ||
| } = codebaseIndexConfig as any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The as any type assertion was introduced to support the new property. Since codebaseIndexMaxBatchRetries is properly defined as optional in the Zod schema (packages/types/src/codebase-index.ts), consider using a more targeted approach that preserves type safety for the other properties. For example, you could access the new field separately:
| codebaseIndexSearchMaxResults, | |
| } = codebaseIndexConfig | |
| codebaseIndexMaxBatchRetries, | |
| } = codebaseIndexConfig as any | |
| } = codebaseIndexConfig | |
| const codebaseIndexMaxBatchRetries = (codebaseIndexConfig as { codebaseIndexMaxBatchRetries?: number }).codebaseIndexMaxBatchRetries |
This is a minor suggestion - the current implementation works correctly.
Fix it with Roo Code or mention @roomote and request a fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roomote request a fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixaroo
See task on Roo Cloud
Fixed the reported issue. Replaced as any with a targeted type cast for codebaseIndexMaxBatchRetries. All local checks passed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixaroo
See task on Roo Cloud
Added missing maxBatchRetriesLabel and maxBatchRetriesDescription translation keys to all 17 webview-ui locale settings.json files. All local checks passed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roomote The translation file is currently missing, please fix it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixaroo
See task on Roo Cloud
The missing translation keys have been added to all locale files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixaroo
See task on Roo Cloud
The fix was already applied in previous commits. Verified all local checks pass:
- Unit tests: 5031 passed
- Type checks: pass
- Lint: pass
- Translations: complete
The earlier CI failure was in check-translations (not platform-unit-test), and this was resolved in commit 3 which added the missing i18n keys to all locale files.
|
@roomote Review the changes and fix them to ensure they pass Code QA Roo Code / platform-unit-test. |
The CI failure was identified as a flaky Windows build issue (race condition in esbuild between No code changes were required. |
Related GitHub Issue
Closes: #10396
Description
This PR attempts to address Issue #10396 by adding a user-configurable setting for the maximum number of batch retries during codebase indexing.
Implementation details:
Type definitions (
packages/types/src/codebase-index.ts):CODEBASE_INDEX_DEFAULTS:MIN_BATCH_RETRIES: 1,MAX_BATCH_RETRIES: 10,DEFAULT_BATCH_RETRIES: 3,BATCH_RETRIES_STEP: 1codebaseIndexMaxBatchRetriesfield to the config schemaConfig manager (
src/services/code-index/config-manager.ts):maxBatchRetriesprivate fieldcurrentMaxBatchRetriesgetter to expose the setting_loadAndSetConfiguration()to read the new setting from globalStateScanner (
src/services/code-index/processors/scanner.ts):maxBatchRetriesparameterMAX_BATCH_RETRIESreferences to usethis.maxBatchRetriesService factory (
src/services/code-index/service-factory.ts):createDirectoryScanner()to passmaxBatchRetriesfrom config managerUI (
webview-ui/src/components/chat/CodeIndexPopover.tsx):codebaseIndexMaxBatchRetriestoLocalCodeIndexSettingsinterfacegetDefaultSettings()codebaseIndexConfigi18n (
webview-ui/src/i18n/locales/en/settings.json):maxBatchRetriesLabelandmaxBatchRetriesDescriptionTest Procedure
tsc --noEmitfor bothsrc/andwebview-ui/- no errorsPre-Submission Checklist
Documentation Updates
Additional Notes
This is part of the ongoing work to expose configurable chunking and batch processing parameters for codebase indexing (Issue #10396). Feedback and guidance are welcome!