feat(bedrock): add Cohere Embed v4 model and improve credential handling (Fixes #11823)#11824
Draft
cscvenkatmadurai wants to merge 1 commit intoRooCodeInc:mainfrom
Draft
Conversation
- Add cohere.embed-v4:0 (1536-dim) to Bedrock embedding model profiles - Add v4-specific request format (embedding_types: ["float"]) and response parsing (embeddings.float[0]) in BedrockEmbedder - Replace fromEnv() with fromNodeProviderChain() for default credential chain when no AWS profile is specified, supporting SSO, IMDS, ECS, and other credential sources with built-in memoization - Add unit tests for Cohere v4 request/response handling, credential provider selection, and v3 regression coverage Fixes RooCodeInc#11823
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
Fixes #11823
Adds Cohere Embed v4 (
cohere.embed-v4:0) support for Bedrock code indexing and fixes credential refresh for long-running indexing sessions on large codebases.Changes
1. Cohere Embed v4 Support (Text-Only)
cohere.embed-v4:0to Bedrock embedding model profiles with dimension 1536embedding_types: ["float"]parameter{embeddings: {float: [[...]]}}structure2. Credential Refresh Fix
fromEnv()withfromNodeProviderChain()as the default credential fallback when no AWS profile is specifiedfromNodeProviderChain()supports all credential sources (env vars, SSO, INI, IMDS, ECS) with built-in memoization and auto-refresh3. Tests
Files Changed (3 files)
src/services/code-index/embedders/bedrock.ts— Credential fix + Cohere v4 request/responsesrc/shared/embeddingModels.ts— New model profile entrysrc/services/code-index/embedders/__tests__/bedrock.spec.ts— 5 new testsRoadmap Alignment
This aligns with: "Expand robust support for a wide variety of AI providers and models."
Testing
Related: aws-samples/bedrock-access-gateway#212
Interactively review PR in Roo Code Cloud