Remove all Warp server AI model fetching — use only local providers
Galaxy should never call Warp's cloud API for AI. This is a policy requirement. All model availability is now determined exclusively by locally configured providers (Bedrock and/or OpenAI/LiteLLM). Changes: - Disable refresh_authed_models, refresh_public_models, refresh_available_models (now no-ops with debug log) - Disable on_server_update and update_feature_model_choices - Disable get_cached_models (no stale server models restored from cache) - Replace ModelsByFeature::default() with minimal placeholder that gets stripped by inject_bedrock_models/inject_openai_models - Make inject_bedrock_models strip Unknown placeholders unconditionally - Make default_llm_info() return a static fallback instead of panicking when no models are configured (prevents null reference crashes) - Add has_any_provider_models() for UI to check provider availability - Make ProviderConfig::None return a user-friendly error instead of calling Warp's cloud API (the previous fallback behavior) Safety: if no providers are enabled, the system gracefully returns an error message rather than crashing or silently calling Warp's servers.
This commit is contained in:
@@ -198,31 +198,16 @@ pub async fn generate_multi_agent_output(
|
||||
}
|
||||
}
|
||||
ProviderConfig::None => {
|
||||
let response_stream = warp_multi_agent_client::generate_multi_agent_output(
|
||||
server_api.base_client().as_ref(),
|
||||
&request,
|
||||
)
|
||||
.await;
|
||||
match response_stream {
|
||||
Ok(stream) => {
|
||||
let output_stream = stream
|
||||
.then(|result| async {
|
||||
match result {
|
||||
Ok(event) => Ok(event),
|
||||
Err(error) => Err(convert_multi_agent_client_error(error).await),
|
||||
}
|
||||
})
|
||||
.take_until(cancellation_rx);
|
||||
Ok(Box::pin(output_stream))
|
||||
}
|
||||
Err(e) => {
|
||||
let (tx, rx) = async_channel::unbounded();
|
||||
let _ = tx
|
||||
.send(Err(convert_multi_agent_client_error(e).await))
|
||||
.await;
|
||||
Ok(Box::pin(rx))
|
||||
}
|
||||
}
|
||||
// No provider configured — do not fall back to Warp's cloud API.
|
||||
let err = Arc::new(crate::server::server_api::AIApiError::Stream {
|
||||
stream_type: "none",
|
||||
source: anyhow::anyhow!(
|
||||
"No AI provider configured. Enable Bedrock or OpenAI/LiteLLM in settings."
|
||||
),
|
||||
});
|
||||
let (tx, rx) = async_channel::unbounded();
|
||||
let _ = tx.send(Err(err)).await;
|
||||
Ok(Box::pin(rx))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user