Skip to content

Timeout configuration too aggressive when using Ollama for codebase index embeddingΒ #5733

@danntee

Description

@danntee

App Version

3.23.11

API Provider

Ollama

Model Used

nomic-embed-code

Roo Code Task Links (Optional)

No response

πŸ” Steps to Reproduce

1. Setup (OS, extension version, settings)

  • Operating System: Windows 11
  • Roo Code Version: 3.23.11
  • Ollama Version: 0.9.6
  • Ollama Model: nomic-embed-code
  • Configuration Settings:
    {
      "embedding": {
        "provider": "ollama",
        "model": "nomic-embed-code",
        "baseUrl": "http://localhost:11434"
      }
    }

2. Exact actions (clicks, input, files, commands)

Start Ollama service

ollama serve

Pull and run the embedding model

ollama pull nomic-embed-code

Open Roo Code client

  • Configure Ollama as embedding provider

Go to Settings β†’ Embedding Provider

  • Select "Ollama"
  • Set model name: nomic-embed-code
  • Set URL: http://localhost:11434

Attempt to index the codebase

  • Open project folder
  • Click "Start Indexing" or execute indexing command

2. What happened after each step

  • βœ… Ollama service started successfully, port 11434 accessible
  • βœ… Embedding model downloaded and running normally
  • βœ… Roo Code client started normally
  • βœ… Ollama provider configuration saved successfully
  • ❌ Issue occurred:
    • Indexing started, needed to process 1629 code blocks
    • Successfully indexed 909 code blocks, then problems began
    • Roo Code Error Message:

      Error - Failed during initial scan: Indexing partially failed: Only 909 of 1629 blocks were indexed. Batch processing failed after 3 attempts: Failed to connect to embedder service. Please check your connection settings and ensure the service is running.

    • Ollama Server Logs (Time: 2025-07-15T16:51:07.228+08:00):
      level=INFO source=server.go:907 msg="aborting embedding request due to client closing the connection"
      
      This error message appeared multiple times.

3. Behavior Analysis

Expected Behavior

  • Indexing should complete all 1629 code blocks successfully.
  • The client should wait for Ollama to complete each embedding request.

Actual Behavior

  • The client starts timing out when processing reaches 909/1629 code blocks.
  • The connection is actively closed by the client, causing Ollama to abort ongoing requests.
  • Complete failure after 3 retry attempts.

Image

4. Suggestions

  • Add a configurable timeout setting for the embedding provider. This would allow users to increase the timeout duration for models or hardware that require more time to process embedding requests, preventing the client from prematurely closing the connection.

Image

πŸ’₯ Outcome Summary

Expected codebase indexing to complete successfully, but Roo Code client timed out and closed connections prematurely, causing Ollama to abort embedding requests mid-process.

πŸ“„ Relevant Logs or Errors (Optional)

Metadata

Metadata

Assignees

Labels

Issue - In ProgressSomeone is actively working on this. Should link to a PR soon.bugSomething isn't workingenhancementNew feature or request

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions