feat: feature-gate AWS provider dependencies behind aws-providers (#8080)

Signed-off-by: DaeHee Lee <lee111dae11@proton.me>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
이대희
2026-03-25 17:55:41 +09:00
committed by GitHub
parent 9849671413
commit 772e37fb54
7 changed files with 32 additions and 11 deletions
+2 -1
View File
@@ -68,9 +68,10 @@ sigstore-verify = { version = "0.6", default-features = false, features = ["rust
winapi = { workspace = true }
[features]
default = ["code-mode", "local-inference"]
default = ["code-mode", "local-inference", "aws-providers"]
code-mode = ["goose/code-mode", "goose-acp/code-mode"]
local-inference = ["goose/local-inference"]
aws-providers = ["goose/aws-providers"]
cuda = ["goose/cuda", "local-inference"]
# disables the update command
disable-update = []
+2 -1
View File
@@ -11,9 +11,10 @@ description.workspace = true
workspace = true
[features]
default = ["code-mode", "local-inference"]
default = ["code-mode", "local-inference", "aws-providers"]
code-mode = ["goose/code-mode"]
local-inference = ["goose/local-inference"]
aws-providers = ["goose/aws-providers"]
cuda = ["goose/cuda", "local-inference"]
[dependencies]
+13 -7
View File
@@ -8,7 +8,7 @@ repository.workspace = true
description.workspace = true
[features]
default = ["code-mode", "local-inference"]
default = ["code-mode", "local-inference", "aws-providers"]
code-mode = ["dep:pctx_code_mode"]
local-inference = [
"dep:candle-core",
@@ -20,6 +20,12 @@ local-inference = [
"dep:rubato",
"dep:byteorder",
]
aws-providers = [
"dep:aws-config",
"dep:aws-smithy-types",
"dep:aws-sdk-bedrockruntime",
"dep:aws-sdk-sagemakerruntime",
]
cuda = ["local-inference", "candle-core/cuda", "candle-nn/cuda", "llama-cpp-2/cuda"]
[lints]
@@ -96,13 +102,13 @@ sqlx = { version = "0.8", default-features = false, features = [
"migrate",
] }
# For Bedrock provider
aws-config = { version = "=1.8.12", features = ["behavior-version-latest"] }
aws-smithy-types = "=1.3.5"
aws-sdk-bedrockruntime = { version = "=1.120.0", default-features = false, features = ["default-https-client", "rt-tokio"] }
# For Bedrock provider (optional, behind "aws-providers" feature)
aws-config = { version = "=1.8.12", features = ["behavior-version-latest"], optional = true }
aws-smithy-types = { version = "=1.3.5", optional = true }
aws-sdk-bedrockruntime = { version = "=1.120.0", default-features = false, features = ["default-https-client", "rt-tokio"], optional = true }
# For SageMaker TGI provider
aws-sdk-sagemakerruntime = { version = "1.62.0", default-features = false, features = ["default-https-client", "rt-tokio"] }
# For SageMaker TGI provider (optional, behind "aws-providers" feature)
aws-sdk-sagemakerruntime = { version = "1.62.0", default-features = false, features = ["default-https-client", "rt-tokio"], optional = true }
# For GCP Vertex AI provider auth
jsonwebtoken = { version = "10.3.0", features = ["aws_lc_rs"] }
@@ -1,4 +1,5 @@
pub mod anthropic;
#[cfg(feature = "aws-providers")]
pub mod bedrock;
pub mod databricks;
pub mod gcpvertexai;
+6 -2
View File
@@ -1,13 +1,16 @@
use std::sync::{Arc, RwLock};
#[cfg(feature = "aws-providers")]
use super::bedrock::BedrockProvider;
#[cfg(feature = "local-inference")]
use super::local_inference::LocalInferenceProvider;
#[cfg(feature = "aws-providers")]
use super::sagemaker_tgi::SageMakerTgiProvider;
use super::{
anthropic::AnthropicProvider,
avian::AvianProvider,
azure::AzureProvider,
base::{Provider, ProviderMetadata},
bedrock::BedrockProvider,
chatgpt_codex::ChatGptCodexProvider,
claude_acp::ClaudeAcpProvider,
claude_code::ClaudeCodeProvider,
@@ -26,7 +29,6 @@ use super::{
openai::OpenAiProvider,
openrouter::OpenRouterProvider,
provider_registry::ProviderRegistry,
sagemaker_tgi::SageMakerTgiProvider,
snowflake::SnowflakeProvider,
tetrate::TetrateProvider,
venice::VeniceProvider,
@@ -49,6 +51,7 @@ async fn init_registry() -> RwLock<ProviderRegistry> {
registry.register::<AnthropicProvider>(true);
registry.register::<AvianProvider>(false);
registry.register::<AzureProvider>(false);
#[cfg(feature = "aws-providers")]
registry.register::<BedrockProvider>(false);
#[cfg(feature = "local-inference")]
registry.register::<LocalInferenceProvider>(false);
@@ -69,6 +72,7 @@ async fn init_registry() -> RwLock<ProviderRegistry> {
registry.register::<OllamaProvider>(true);
registry.register::<OpenAiProvider>(true);
registry.register::<OpenRouterProvider>(true);
#[cfg(feature = "aws-providers")]
registry.register::<SageMakerTgiProvider>(false);
registry.register::<SnowflakeProvider>(false);
registry.register::<TetrateProvider>(true);
+2
View File
@@ -5,6 +5,7 @@ pub mod avian;
pub mod azure;
pub mod azureauth;
pub mod base;
#[cfg(feature = "aws-providers")]
pub mod bedrock;
pub mod canonical;
pub mod catalog;
@@ -38,6 +39,7 @@ pub mod openrouter;
pub mod provider_registry;
pub mod provider_test;
mod retry;
#[cfg(feature = "aws-providers")]
pub mod sagemaker_tgi;
pub mod snowflake;
pub mod testprovider;
+6
View File
@@ -10,6 +10,7 @@ use goose::permission::{Permission, PermissionConfirmation};
use goose::providers::anthropic::ANTHROPIC_DEFAULT_MODEL;
use goose::providers::azure::AZURE_DEFAULT_MODEL;
use goose::providers::base::Provider;
#[cfg(feature = "aws-providers")]
use goose::providers::bedrock::BEDROCK_DEFAULT_MODEL;
use goose::providers::claude_code::CLAUDE_CODE_DEFAULT_MODEL;
use goose::providers::codex::CODEX_DEFAULT_MODEL;
@@ -19,6 +20,7 @@ use goose::providers::errors::ProviderError;
use goose::providers::google::GOOGLE_DEFAULT_MODEL;
use goose::providers::litellm::LITELLM_DEFAULT_MODEL;
use goose::providers::openai::OPEN_AI_DEFAULT_MODEL;
#[cfg(feature = "aws-providers")]
use goose::providers::sagemaker_tgi::SAGEMAKER_TGI_DEFAULT_MODEL;
use goose::providers::snowflake::SNOWFLAKE_DEFAULT_MODEL;
use goose::providers::xai::XAI_DEFAULT_MODEL;
@@ -731,6 +733,7 @@ async fn test_azure_provider() -> Result<()> {
.await
}
#[cfg(feature = "aws-providers")]
#[tokio::test]
async fn test_bedrock_provider_long_term_credentials() -> Result<()> {
ProviderTestConfig::with_llm_provider(
@@ -742,6 +745,7 @@ async fn test_bedrock_provider_long_term_credentials() -> Result<()> {
.await
}
#[cfg(feature = "aws-providers")]
#[tokio::test]
async fn test_bedrock_provider_aws_profile_credentials() -> Result<()> {
ProviderTestConfig::with_llm_provider("aws_bedrock", BEDROCK_DEFAULT_MODEL, &["AWS_PROFILE"])
@@ -750,6 +754,7 @@ async fn test_bedrock_provider_aws_profile_credentials() -> Result<()> {
.await
}
#[cfg(feature = "aws-providers")]
#[tokio::test]
async fn test_bedrock_provider_bearer_token() -> Result<()> {
ProviderTestConfig::with_llm_provider(
@@ -827,6 +832,7 @@ async fn test_snowflake_provider() -> Result<()> {
.await
}
#[cfg(feature = "aws-providers")]
#[tokio::test]
async fn test_sagemaker_tgi_provider() -> Result<()> {
ProviderTestConfig::with_llm_provider(