Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jul 15, 2025

This PR implements configurable timeout settings for the Ollama embedder to resolve issue #5733.

Changes Made

Core Implementation

  • Ollama Embedder Timeout Configuration: Added configurable timeout parameters for embedding operations (default: 30s) and validation operations (default: 10s)
  • Configuration Interface Updates: Extended type definitions and configuration schemas to support timeout settings
  • Webview Message Handling: Updated message handlers to process and persist timeout settings in VSCode global state

User Interface

  • Settings UI Components: Added timeout configuration fields in the CodeIndexPopover with proper validation and user-friendly tooltips
  • Input Validation: Implemented range validation (1-300s for embedding, 1-60s for validation) with helpful error messages
  • Internationalization: Added translation keys for all timeout-related UI text

Technical Details

  • Type Safety: All timeout configurations are properly typed with Zod schemas and TypeScript interfaces
  • Backward Compatibility: Existing configurations continue to work with sensible defaults
  • Configuration Pipeline: Timeout settings integrate seamlessly with existing configuration management
  • Test Coverage: Added comprehensive test coverage for timeout functionality

Problem Solved

Previously, the Ollama embedder used hardcoded 10-second timeouts for embedding requests, which was too aggressive for large codebases. Users reported indexing failures partway through large repositories due to connection timeouts.

This implementation allows users to configure appropriate timeout values based on their:

  • Hardware capabilities
  • Network conditions
  • Codebase size
  • Ollama model performance

Default Values

  • Embedding Timeout: 30 seconds (3x the previous hardcoded value)
  • Validation Timeout: 10 seconds (maintains existing validation timeout)

These defaults provide a good balance between responsiveness and reliability for most use cases, while allowing customization for specific needs.

Fixes #5733


Important

This PR adds configurable timeout settings for the Ollama embedder, including UI updates, configuration management, and test coverage.

  • Behavior:
    • Adds configurable timeout settings for Ollama embedder in codebase-index.ts and webviewMessageHandler.ts.
    • Default timeouts: 30s for embedding, 10s for validation.
    • Updates CodeIndexOllamaEmbedder in ollama.ts to use new timeout settings.
  • Configuration:
    • Extends CodebaseIndexConfig and OllamaConfigOptions in config.ts to include timeout settings.
    • Updates CodeIndexConfigManager in config-manager.ts to load and manage new settings.
  • UI and Validation:
    • Adds timeout configuration fields in CodeIndexPopover.tsx with validation and tooltips.
    • Updates settings.json for internationalization of timeout-related text.
  • Testing:
    • Adds test for timeout parameters in service-factory.spec.ts to ensure they are passed correctly to the embedder.

This description was created by Ellipsis for 7647fd1. You can customize this summary. It will automatically update as commits are pushed.

- Add timeout configuration options for Ollama embedding and validation operations
- Default to 30s for embedding requests and 10s for validation requests
- Add UI components in CodeIndexPopover for timeout configuration with validation
- Update configuration interfaces and type definitions to support timeout settings
- Integrate timeout settings into existing configuration management pipeline
- Add comprehensive test coverage for timeout functionality
- Add translation support for timeout settings

Fixes #5733
@roomote roomote bot requested review from cte, jr and mrubens as code owners July 15, 2025 12:25
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Jul 15, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 15, 2025
@daniel-lxs daniel-lxs moved this from Triage to Roomote/renovate BOT in Roo Code Roadmap Jul 15, 2025
@daniel-lxs daniel-lxs closed this Sep 16, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Sep 16, 2025
@github-project-automation github-project-automation bot moved this from Renovate BOT to Done in Roo Code Roadmap Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Timeout configuration too aggressive when using Ollama for codebase index embedding

3 participants