Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/providers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,15 @@ pub fn create_resilient_provider(
continue;
}

if api_key.is_some() && fallback != "ollama" {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The exception for ollama in this condition seems incorrect and could hide a potential misconfiguration. If the primary provider uses an API key (e.g., OpenAI's sk-...), that key will be passed to the OllamaProvider and misinterpreted as a base URL, causing connection failures. The warning should apply to ollama as well to alert the user of this likely incorrect configuration. A better long-term solution might be to handle API keys for different providers separately, but for now, removing this exception would make the warning more robust.

Suggested change
if api_key.is_some() && fallback != "ollama" {
if api_key.is_some() {

tracing::warn!(
fallback_provider = fallback,
primary_provider = primary_name,
"Fallback provider will use the primary provider's API key — \
this will fail if the providers require different keys"
);
}

match create_provider(fallback, api_key) {
Ok(provider) => providers.push((fallback.clone(), provider)),
Err(e) => {
Expand Down
6 changes: 4 additions & 2 deletions src/providers/reliable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ impl ReliableProvider {
#[async_trait]
impl Provider for ReliableProvider {
async fn warmup(&self) -> anyhow::Result<()> {
if let Some((name, provider)) = self.providers.first() {
for (name, provider) in &self.providers {
tracing::info!(provider = name, "Warming up provider connection pool");
provider.warmup().await?;
if let Err(e) = provider.warmup().await {
tracing::warn!(provider = name, "Warmup failed (non-fatal): {e}");
}
}
Ok(())
}
Expand Down
7 changes: 2 additions & 5 deletions src/tools/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,8 @@ impl Tool for ShellTool {
}
}

let result = tokio::time::timeout(
Duration::from_secs(SHELL_TIMEOUT_SECS),
cmd.output(),
)
.await;
let result =
tokio::time::timeout(Duration::from_secs(SHELL_TIMEOUT_SECS), cmd.output()).await;

match result {
Ok(Ok(output)) => {
Expand Down
Loading