From 408559ad1681d1bfc742ed8dfb4f0678da260814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E6=A5=BD=E5=9D=82=C2=B7=E5=96=B5?= Date: Sat, 6 Dec 2025 15:46:41 +0800 Subject: [PATCH] docs: add commet to warn disabled timeout Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- packages/types/src/provider-settings.ts | 1 + src/services/code-index/embedders/ollama.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/packages/types/src/provider-settings.ts b/packages/types/src/provider-settings.ts index ed84048949..499430ba2d 100644 --- a/packages/types/src/provider-settings.ts +++ b/packages/types/src/provider-settings.ts @@ -266,6 +266,7 @@ const ollamaSchema = baseProviderSettingsSchema.extend({ ollamaBaseUrl: z.string().optional(), ollamaApiKey: z.string().optional(), ollamaEmbeddingTimeoutMs: z.number().int().optional(), + // Negative values disable the validation timeout. If set to a positive integer, it specifies the timeout in milliseconds. ollamaValidationTimeoutMs: z.number().int().optional(), ollamaNumCtx: z.number().int().min(128).optional(), }) diff --git a/src/services/code-index/embedders/ollama.ts b/src/services/code-index/embedders/ollama.ts index 23a90c4e5f..b62a238300 100644 --- a/src/services/code-index/embedders/ollama.ts +++ b/src/services/code-index/embedders/ollama.ts @@ -222,6 +222,8 @@ export class CodeIndexOllamaEmbedder implements IEmbedder { // Add timeout for test request too const testController = new AbortController() let testTimeoutId = undefined + // If validationTimeoutMs is <= 0, the timeout is disabled (no abort will be triggered). + // Set validationTimeoutMs to a positive integer (milliseconds) to enable the timeout. if (this.validationTimeoutMs > 0) { testTimeoutId = setTimeout(() => testController.abort(), this.validationTimeoutMs) }