feat: Add bedrock provider package#192
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default mode and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit dffd3b8. Configure here.
| duration_ms=metrics.duration_ms, | ||
| ), | ||
| raw=response, | ||
| ) |
There was a problem hiding this comment.
Metrics drop tool_calls on empty-content error paths
Low Severity
When the Bedrock model responds with only toolUse content blocks and no text (a valid scenario when tools are configured via parameters), extract_content_from_response returns empty string. The code then constructs a new LDAIMetrics passing tokens and duration_ms from the original metrics but omitting tool_calls. This loses diagnostic information about which tools the model attempted to invoke. The same pattern appears in the structured-output JSON decode failure path.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit dffd3b8. Configure here.
Introduce launchdarkly-server-sdk-ai-bedrock, an AWS Bedrock provider for the LaunchDarkly AI SDK. The model runner wraps boto3 bedrock-runtime.converse(...) via asyncio.to_thread. The agent runner integrates the Strands Agents SDK, available through the optional [agents] extra. Agent-graph support is intentionally deferred — create_agent_graph raises NotImplementedError. The package mirrors the OpenAI provider layout: BedrockRunnerFactory, BedrockModelRunner, BedrockAgentRunner, helper module, and tests. Register the new package in the workspace pyproject.toml, root Makefile, release-please configuration, and CI / release workflows. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
dffd3b8 to
e678074
Compare


Summary
launchdarkly-server-sdk-ai-bedrockprovider package atpackages/ai-providers/server-ai-bedrock/.bedrock-runtime.converse(...)(async viaasyncio.to_thread).[agents]extra so the package works without it installed.create_agent_graph(...)raisesNotImplementedError. Follow-up work will land that piece.BedrockRunnerFactory,BedrockModelRunner,BedrockAgentRunner,bedrock_helper(message/tool conversion, metrics extraction,map_provider), and matching tests.pyproject.toml, rootMakefile,release-please-config.json/.release-please-manifest.json, and.github/workflows/{ci,release-please}.yml.launchdarkly-server-sdk-ai-bedrockis already reserved at0.0.0(placeholder). First real release will be0.1.0via release-please.Depends on #191 (bedrock tracker-method removal). #191 should merge first.
feat: Add bedrock provider package for AWS Bedrock + Strands
Test plan
make testin the new package — 42 passedmake testacross the workspace — 377 passed (201 server-ai + 88 langchain + 46 openai + 42 bedrock)make lintacross all four packages — cleanmake buildin the new package produces wheel + sdist;twine checkpassesstrands-agentsversion floor (currently>=0.1.0)Notes for reviewers
json.loads. Bedrock's nativetoolConfigis a more reliable structured-output mechanism but doesn't map cleanly to the OpenAI provider'sparsedshape. Reasonable follow-up.tool_callsfrom the agent runner: Strands aggregates per-tool call counts rather than preserving invocation order; the runner emits each name repeated bycall_count. Model runner returns names in response order.LDAIMetrics.successis derived strictly fromHTTPStatusCode == 200, matching the priortrack_bedrock_converse_metricssemantics.🤖 Generated with Claude Code
Note
Medium Risk
Adds a new Bedrock provider implementation and wires it into CI and automated PyPI publishing, so failures could impact release automation and provider selection paths.
Overview
Adds a new
packages/ai-providers/server-ai-bedrockdistribution (launchdarkly-server-sdk-ai-bedrock) implementing a BedrockAIProviderwith aBedrockModelRunner(boto3converseviaasyncio.to_thread, toolConfig support, and schema-injection structured output) plus an experimentalBedrockAgentRunnerbacked by optionalstrands-agents;create_agent_graphis explicitly unsupported.Updates repo plumbing to include Bedrock everywhere: uv workspace membership, root
Makefileinstall/test/lint/build targets, CI jobs for Linux+Windows, and release-please configuration/manifest plus a new release job to publish the Bedrock package to PyPI with provenance attestation.Reviewed by Cursor Bugbot for commit e678074. Bugbot is set up for automated code reviews on this repo. Configure here.