Skip to content

Commit a405df5

Browse files
authored
Fix RooCodeInc#2941 ollama timeout (RooCodeInc#3024)
* Fix: Increase Ollama provider timeout from 30s to 120s * Add changeset for Ollama provider timeout fix
1 parent 04d1f1d commit a405df5

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.changeset/red-yaks-call.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"claude-dev": patch
3+
---
4+
5+
Fix Ollama provider timeout by increasing it from 30 sec to 120 seconds to accommodate model loading time

src/api/providers/__tests__/ollama.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ describe("OllamaHandler", () => {
9696
try {
9797
// Create a promise that rejects after a short timeout
9898
const timeoutPromise = new Promise<never>((_, reject) => {
99-
setTimeout(() => reject(new Error("Ollama request timed out after 30 seconds")), 100)
99+
setTimeout(() => reject(new Error("Ollama request timed out after 120 seconds")), 100)
100100
})
101101

102102
// Create a promise that never resolves
@@ -125,7 +125,7 @@ describe("OllamaHandler", () => {
125125
}
126126

127127
// Check the result
128-
errorMessage.should.equal("Ollama request timed out after 30 seconds")
128+
errorMessage.should.equal("Ollama request timed out after 120 seconds")
129129

130130
// Restore the fake timers for other tests
131131
clock = sinon.useFakeTimers()

src/api/providers/ollama.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class OllamaHandler implements ApiHandler {
2222
try {
2323
// Create a promise that rejects after timeout
2424
const timeoutPromise = new Promise<never>((_, reject) => {
25-
setTimeout(() => reject(new Error("Ollama request timed out after 30 seconds")), 30000)
25+
setTimeout(() => reject(new Error("Ollama request timed out after 120 seconds")), 120000)
2626
})
2727

2828
// Create the actual API request promise
@@ -63,7 +63,7 @@ export class OllamaHandler implements ApiHandler {
6363
} catch (error: any) {
6464
// Check if it's a timeout error
6565
if (error.message && error.message.includes("timed out")) {
66-
throw new Error("Ollama request timed out after 30 seconds")
66+
throw new Error("Ollama request timed out after 120 seconds")
6767
}
6868

6969
// Enhance error reporting

0 commit comments

Comments
 (0)