From bf3755ba753b8ca62563f29e7c04b769c8fdcfaa Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 1 Jul 2026 14:56:35 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20[code=20health]=20Remove=20depre?= =?UTF-8?q?cated=20New=20function=20from=20bedrock=20backend?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: matdev83 <211248003+matdev83@users.noreply.github.com> --- internal/plugins/backends/bedrock/plugin.go | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/internal/plugins/backends/bedrock/plugin.go b/internal/plugins/backends/bedrock/plugin.go index 79a70bfa..d2ff3172 100644 --- a/internal/plugins/backends/bedrock/plugin.go +++ b/internal/plugins/backends/bedrock/plugin.go @@ -21,20 +21,10 @@ func defaultBackendCaps() lipapi.BackendCaps { } // DefaultLoadConfigTimeout bounds AWS SDK default configuration loading during backend construction. -// New applies it automatically; composition roots calling NewWithContext should wrap their +// Composition roots calling NewWithContext should wrap their // context with context.WithTimeout using this duration (or shorter) unless it already carries a deadline. const DefaultLoadConfigTimeout = 30 * time.Second -// New returns a runtime backend that invokes Bedrock ConverseStream via the AWS SDK v2. -// -// Deprecated: prefer [NewWithContext] with a context whose deadline reflects your bootstrap -// budget. New applies [DefaultLoadConfigTimeout] around AWS config load only. -func New(cfg Config) execbackend.Backend { - ctx, cancel := context.WithTimeout(context.Background(), DefaultLoadConfigTimeout) - defer cancel() - return NewWithContext(ctx, cfg) -} - // ensureLoadConfigDeadline returns a context for awsconfig.LoadDefaultConfig. If ctx is nil, or // has no deadline, it wraps with [DefaultLoadConfigTimeout] so config load cannot hang // indefinitely. The caller must invoke the returned CancelFunc. @@ -48,7 +38,7 @@ func ensureLoadConfigDeadline(ctx context.Context) (context.Context, context.Can return context.WithTimeout(ctx, DefaultLoadConfigTimeout) } -// NewWithContext returns a runtime backend like [New], using ctx for awsconfig.LoadDefaultConfig. +// NewWithContext returns a runtime backend, using ctx for awsconfig.LoadDefaultConfig. // A deadline is always applied for the load step: either ctx's own deadline, or // [DefaultLoadConfigTimeout] when ctx is nil or uncancelled without a deadline. func NewWithContext(ctx context.Context, cfg Config) execbackend.Backend {