fix(AIC-3382): support Bedrock configs in LangChain handlers - #72
Merged
Merged
Conversation
Apply inference-profile prefixes before model construction and report the configured provider so Bedrock calls and telemetry stay aligned. Co-authored-by: Cursor <cursoragent@cursor.com>
Route Bedrock configs through ChatBedrockConverse so callers no longer need to provide a custom model factory. Co-authored-by: Cursor <cursoragent@cursor.com>
jeffdupont
approved these changes
Sep 18, 2026
apucacao
approved these changes
Sep 18, 2026
XieX
reviewed
Sep 18, 2026
XieX
reviewed
Sep 18, 2026
| */ | ||
| function servingProvider(config: AiConfigRep): string { | ||
| return (config.provider?.name ?? '').toLowerCase() === 'anthropic' ? 'anthropic' : 'openai'; | ||
| return (config.provider?.name || 'openai').toLowerCase(); |
There was a problem hiding this comment.
Is it enough to just lowercase them, or should we add a mapping function? Obviously Anthropic -> anthropic and OpenAI -> openai will be fine, but what about some of the others, like "IBM Watson"?
Contributor
Author
There was a problem hiding this comment.
This is just for the telemetry information, so I think that should be fine
Prevent payload-owned tool definitions from leaking into ChatBedrockConverse constructor arguments while preserving the evaluated config. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
Print usage and judges on stdout and drop leftover debug logs so both samples behave the same. Co-authored-by: Cursor <cursoragent@cursor.com>
Merged
andrewklatzke
pushed a commit
that referenced
this pull request
Sep 22, 2026
🤖 I have created a release *beep* *boop* --- <details><summary>@launchdarkly/ai-server: 0.3.0</summary> ## [0.3.0](https://github.com/launchdarkly/js-ai-sdk/compare/@launchdarkly/ai-server-0.2.0...@launchdarkly/ai-server-0.3.0) (2026-09-18) ### Features * **AIC-3106:** add multimodal history support to graph().invoke() ([#18](#18)) ([9737530](9737530)) * **client:** stamp modelKey and modelVersion from _ldMeta on tracking events ([758fe7c](758fe7c)) * **client:** stamp modelKey and modelVersion from _ldMeta on tracking events ([#66](#66)) ([89e4f0e](89e4f0e)) ### Bug Fixes * **client:** harden model stamps, share node trackData builder, keep judge results from inheriting parent model identity ([d374962](d374962)) * **client:** reject blank-string modelVersion and non-string modelKey in model stamps ([f80c016](f80c016)) * extract LangChain content-block text and apply model parameters after eval ([#54](#54)) ([e34e779](e34e779)) * **graph:** prefer node tools before synthetic handoff routing ([#59](#59)) ([0578819](0578819)) * **telemetry:** a tool that returned nothing did not return null ([#21](#21)) ([92cfcee](92cfcee)) </details> <details><summary>@launchdarkly/ai-claude-agents: 0.3.0</summary> ## [0.3.0](https://github.com/launchdarkly/js-ai-sdk/compare/@launchdarkly/ai-claude-agents-0.2.0...@launchdarkly/ai-claude-agents-0.3.0) (2026-09-18) ### Features * **AIC-3106:** add multimodal history support to graph().invoke() ([#18](#18)) ([9737530](9737530)) * **client:** stamp modelKey and modelVersion from _ldMeta on tracking events ([758fe7c](758fe7c)) * **client:** stamp modelKey and modelVersion from _ldMeta on tracking events ([#66](#66)) ([89e4f0e](89e4f0e)) ### Bug Fixes * **client:** harden model stamps, share node trackData builder, keep judge results from inheriting parent model identity ([d374962](d374962)) </details> <details><summary>@launchdarkly/ai-claude-messages: 0.3.0</summary> ## [0.3.0](https://github.com/launchdarkly/js-ai-sdk/compare/@launchdarkly/ai-claude-messages-0.2.0...@launchdarkly/ai-claude-messages-0.3.0) (2026-09-18) ### Features * **AIC-3106:** add multimodal history support to graph().invoke() ([#18](#18)) ([9737530](9737530)) </details> <details><summary>@launchdarkly/ai-openai-agents: 0.3.0</summary> ## [0.3.0](https://github.com/launchdarkly/js-ai-sdk/compare/@launchdarkly/ai-openai-agents-0.2.0...@launchdarkly/ai-openai-agents-0.3.0) (2026-09-18) ### Features * **AIC-3106:** add multimodal history support to graph().invoke() ([#18](#18)) ([9737530](9737530)) * **client:** stamp modelKey and modelVersion from _ldMeta on tracking events ([758fe7c](758fe7c)) * **client:** stamp modelKey and modelVersion from _ldMeta on tracking events ([#66](#66)) ([89e4f0e](89e4f0e)) ### Bug Fixes * **client:** harden model stamps, share node trackData builder, keep judge results from inheriting parent model identity ([d374962](d374962)) </details> <details><summary>@launchdarkly/ai-openai-messages: 0.3.0</summary> ## [0.3.0](https://github.com/launchdarkly/js-ai-sdk/compare/@launchdarkly/ai-openai-messages-0.2.0...@launchdarkly/ai-openai-messages-0.3.0) (2026-09-18) ### Features * **AIC-3106:** add multimodal history support to graph().invoke() ([#18](#18)) ([9737530](9737530)) </details> <details><summary>@launchdarkly/ai-langchain-agents: 0.3.0</summary> ## [0.3.0](https://github.com/launchdarkly/js-ai-sdk/compare/@launchdarkly/ai-langchain-agents-0.2.0...@launchdarkly/ai-langchain-agents-0.3.0) (2026-09-18) ### Features * **AIC-3106:** add multimodal history support to graph().invoke() ([#18](#18)) ([9737530](9737530)) * **client:** stamp modelKey and modelVersion from _ldMeta on tracking events ([758fe7c](758fe7c)) * **client:** stamp modelKey and modelVersion from _ldMeta on tracking events ([#66](#66)) ([89e4f0e](89e4f0e)) ### Bug Fixes * **AIC-3382:** support Bedrock configs in LangChain handlers ([#72](#72)) ([a1487cf](a1487cf)) * **client:** harden model stamps, share node trackData builder, keep judge results from inheriting parent model identity ([d374962](d374962)) * extract LangChain content-block text and apply model parameters after eval ([#54](#54)) ([e34e779](e34e779)) </details> <details><summary>@launchdarkly/ai-langchain-messages: 0.3.0</summary> ## [0.3.0](https://github.com/launchdarkly/js-ai-sdk/compare/@launchdarkly/ai-langchain-messages-0.2.0...@launchdarkly/ai-langchain-messages-0.3.0) (2026-09-18) ### Features * **AIC-3106:** add multimodal history support to graph().invoke() ([#18](#18)) ([9737530](9737530)) ### Bug Fixes * **AIC-3382:** support Bedrock configs in LangChain handlers ([#72](#72)) ([a1487cf](a1487cf)) * extract LangChain content-block text and apply model parameters after eval ([#54](#54)) ([e34e779](e34e779)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > **Release Please cut** that bumps `@launchdarkly/ai-server` and the Claude, OpenAI, and LangChain agent/message packages from **0.2.0 → 0.3.0**, updates `.release-please-manifest.json`, embedded `LD_AI_PACKAGE_VERSION` constants, and adds **0.3.0** changelog sections (no runtime code in this diff). > > The **0.3.0** notes capture already-merged work: **multimodal conversation history** on `graph().invoke()`, **modelKey/modelVersion** on tracking events from `_ldMeta` (with validation and judge events not inheriting parent model identity), plus fixes for **graph tool routing**, **LangChain** text extraction / post-eval model params and **Bedrock** configs, and **telemetry** for empty tool results. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 6130d2c. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
TypeScript counterpart to launchdarkly/python-ai-sdk#101. Three fixes for LangChain handlers (
langchain-agentsandlangchain-messages):llmnow instantiate@langchain/aws'sChatBedrockConverseinstead of falling through toChatOpenAI. Model parameters and the region-prefixed model ID are forwarded.@langchain/awsis an optional peer dependency, with a clear install error when absent.model.regionis prepended to the model ID as an inference-profile prefix. Prefixing is idempotent and applies to default constructors and user-supplied factories without mutating the caller's config.gen_ai.provider.namenow reports the configured provider lower-cased rather than collapsing non-Anthropic providers to OpenAI.gen_ai.systemremainslangchain.The streaming example also falls back to the final response when no chunk events are emitted.
Test plan
Jira: AIC-3382
Note
Overview
Adds AWS Bedrock as a first-class default model path for the
langchain-agentsandlangchain-messageshandlers: Bedrock configs without a customllmnow buildChatBedrockConversevia dynamic@langchain/awsimport (optional peer; clear error if missing).Bedrock model IDs get
model.regionprepended once as an inference-profile prefix (us.model…), without double-prefixing or mutating the caller’s config; factories receive a shallow copy with the resolved name. Bedrock constructor args droptoolsfrommodel.parametersso tool wiring stays on the agent/handler side.OpenTelemetry
gen_ai.provider.nameis now the configured provider name lower-cased (empty →openai), not onlyanthropicvsopenai;gen_ai.systemstayslangchain.The streaming example prints the final
responsewhen no chunk events arrive, and logs usage/judge results on stdout instead of stderr debug noise.Reviewed by Cursor Bugbot for commit fc1079d. Bugbot is set up for automated code reviews on this repo. Configure here.