Skip to content

feat: Add bedrock provider package#192

Open
jsonbailey wants to merge 1 commit into
mainfrom
jb/bedrock-provider/remove-tracker-add-provider
Open

feat: Add bedrock provider package#192
jsonbailey wants to merge 1 commit into
mainfrom
jb/bedrock-provider/remove-tracker-add-provider

Conversation

@jsonbailey
Copy link
Copy Markdown
Contributor

@jsonbailey jsonbailey commented May 18, 2026

Summary

  • Adds launchdarkly-server-sdk-ai-bedrock provider package at packages/ai-providers/server-ai-bedrock/.
    • Model runner wraps boto3 bedrock-runtime.converse(...) (async via asyncio.to_thread).
    • Agent runner integrates the Strands Agents SDK, exposed through the optional [agents] extra so the package works without it installed.
    • Agent-graph support intentionally deferredcreate_agent_graph(...) raises NotImplementedError. Follow-up work will land that piece.
  • Mirrors the OpenAI provider layout: BedrockRunnerFactory, BedrockModelRunner, BedrockAgentRunner, bedrock_helper (message/tool conversion, metrics extraction, map_provider), and matching tests.
  • Registers the new package in the workspace pyproject.toml, root Makefile, release-please-config.json / .release-please-manifest.json, and .github/workflows/{ci,release-please}.yml.
  • PyPI name launchdarkly-server-sdk-ai-bedrock is already reserved at 0.0.0 (placeholder). First real release will be 0.1.0 via 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 test in the new package — 42 passed
  • make test across the workspace — 377 passed (201 server-ai + 88 langchain + 46 openai + 42 bedrock)
  • make lint across all four packages — clean
  • make build in the new package produces wheel + sdist; twine check passes
  • Reviewer: confirm strands-agents version floor (currently >=0.1.0)
  • Reviewer: confirm CI workflow matrix additions (linux + windows for the new package)

Notes for reviewers

  • Structured output: implemented via system-prompt JSON-schema injection + json.loads. Bedrock's native toolConfig is a more reliable structured-output mechanism but doesn't map cleanly to the OpenAI provider's parsed shape. Reasonable follow-up.
  • tool_calls from the agent runner: Strands aggregates per-tool call counts rather than preserving invocation order; the runner emits each name repeated by call_count. Model runner returns names in response order.
  • LDAIMetrics.success is derived strictly from HTTPStatusCode == 200, matching the prior track_bedrock_converse_metrics semantics.

🤖 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-bedrock distribution (launchdarkly-server-sdk-ai-bedrock) implementing a Bedrock AIProvider with a BedrockModelRunner (boto3 converse via asyncio.to_thread, toolConfig support, and schema-injection structured output) plus an experimental BedrockAgentRunner backed by optional strands-agents; create_agent_graph is explicitly unsupported.

Updates repo plumbing to include Bedrock everywhere: uv workspace membership, root Makefile install/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.

@jsonbailey jsonbailey requested a review from a team as a code owner May 18, 2026 21:49
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default mode and found 1 potential issue.

Fix All in Cursor

❌ 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,
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)
Fix in Cursor Fix in Web

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>
@jsonbailey jsonbailey force-pushed the jb/bedrock-provider/remove-tracker-add-provider branch from dffd3b8 to e678074 Compare May 19, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant