Skip to content

Ollama times out (regardless of ollama timeout setting) on long-prefill requests (~300s) due to default Undici timeout. #6549

Description

@hadsie

Plugin Type

VSCode Extension

Cline Version

3.32

What happened?

When using the Ollama provider, chats that take longer than 5 minutes to produce the first token fail with "fetch failed". This is caused by Undici’s default headersTimeout (~300s).

Expected: The request should use the configured ollama timeout rather than abort at 300s.

Actual: The HTTP request is terminated around 300s with a transport error.

This seems related to:

Steps to reproduce

  1. Start a local ollama server and load a model that can have slow prefill with big prompts.
  2. In Cline, select the ollama provider and a model with a large context window and a timeout >300 seconds.
  3. Send a request with a very large system+user prompt (or otherwise force a long prefill) so that the model takes more than 300 seconds to reply with the first token.
  4. Note that the fetch fails at 5 minutes, rather than whenever
    Observe that around the 5-minute mark the request fails with a network/headers timeout and no tokens are delivered.

Provider/Model

ollama/qwen3-30b-a3b-q5

System Information

Cline is running in vscode on a Mac M1 Air, Sequioa.
Ollama running on a GTX 3900 with 24GB VRAM.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bot RespondedIssue has received an automated responseP1High priorityVS CodeIssues specific to VS Code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions