From 2ff86bcc72c265fbabad1215bbb5713b88f5e5df Mon Sep 17 00:00:00 2001 From: Douwe Osinga Date: Fri, 15 May 2026 09:52:51 -0400 Subject: [PATCH 1/2] fix: mention configurable timeout env vars in Ollama stream stall error The stall error message now tells users about OLLAMA_STREAM_TIMEOUT, GOOSE_STREAM_TIMEOUT, and OLLAMA_TIMEOUT so they know how to increase the timeout without searching docs. Fixes #8437 Signed-off-by: Douwe Osinga --- crates/goose/src/providers/ollama.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/crates/goose/src/providers/ollama.rs b/crates/goose/src/providers/ollama.rs index 049e6a24ee16..9978cb63d7e8 100644 --- a/crates/goose/src/providers/ollama.rs +++ b/crates/goose/src/providers/ollama.rs @@ -1,7 +1,7 @@ use super::api_client::{ApiClient, AuthMethod}; use super::base::{ - ConfigKey, MessageStream, Provider, ProviderDef, ProviderMetadata, - DEFAULT_PROVIDER_TIMEOUT_SECS, + ConfigKey, DEFAULT_PROVIDER_TIMEOUT_SECS, MessageStream, Provider, ProviderDef, + ProviderMetadata, }; use super::errors::ProviderError; use super::inventory::InventoryIdentityInput; @@ -15,11 +15,11 @@ use crate::providers::formats::ollama::{create_request, response_to_streaming_me use anyhow::{Error, Result}; use async_stream::try_stream; use async_trait::async_trait; -use futures::future::BoxFuture; use futures::TryStreamExt; +use futures::future::BoxFuture; use reqwest::Response; use rmcp::model::Tool; -use serde_json::{json, Value}; +use serde_json::{Value, json}; use std::time::Duration; use tokio::pin; use tokio_stream::StreamExt; @@ -435,7 +435,9 @@ fn with_line_timeout( Err::<(), anyhow::Error>(anyhow::anyhow!( "Ollama stream stalled: no data received for {}s. \ This may indicate the model is overwhelmed by the request payload. \ - Try a smaller model or reduce the number of tools.", + Try a smaller model, reduce the number of tools, or increase the \ + timeout via OLLAMA_STREAM_TIMEOUT, GOOSE_STREAM_TIMEOUT, or \ + OLLAMA_TIMEOUT in your config.", timeout_secs ))?; } From 976fd1e9b4eda23191a501fda8e203922fb2c74c Mon Sep 17 00:00:00 2001 From: Jack Amadeo Date: Fri, 22 May 2026 12:26:30 -0400 Subject: [PATCH 2/2] chore: run cargo fmt --- crates/goose/src/providers/ollama.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/goose/src/providers/ollama.rs b/crates/goose/src/providers/ollama.rs index 9978cb63d7e8..f03afa209d6f 100644 --- a/crates/goose/src/providers/ollama.rs +++ b/crates/goose/src/providers/ollama.rs @@ -1,7 +1,7 @@ use super::api_client::{ApiClient, AuthMethod}; use super::base::{ - ConfigKey, DEFAULT_PROVIDER_TIMEOUT_SECS, MessageStream, Provider, ProviderDef, - ProviderMetadata, + ConfigKey, MessageStream, Provider, ProviderDef, ProviderMetadata, + DEFAULT_PROVIDER_TIMEOUT_SECS, }; use super::errors::ProviderError; use super::inventory::InventoryIdentityInput; @@ -15,11 +15,11 @@ use crate::providers::formats::ollama::{create_request, response_to_streaming_me use anyhow::{Error, Result}; use async_stream::try_stream; use async_trait::async_trait; -use futures::TryStreamExt; use futures::future::BoxFuture; +use futures::TryStreamExt; use reqwest::Response; use rmcp::model::Tool; -use serde_json::{Value, json}; +use serde_json::{json, Value}; use std::time::Duration; use tokio::pin; use tokio_stream::StreamExt;