Skip to content

Commit 56c630c

Browse files
ggoranov-smarroomotemrubensSmartsheet-JB-Brown
authored
Feature/bedrock embeddings support (#9475)
* feat: add AWS Bedrock support for codebase indexing - Add bedrock as a new EmbedderProvider type - Add AWS Bedrock embedding model profiles (titan-embed-text models) - Create BedrockEmbedder class with support for Titan and Cohere models - Add Bedrock configuration support to config manager and interfaces - Update service factory to create BedrockEmbedder instances - Add comprehensive tests for BedrockEmbedder - Add localization strings for Bedrock support Closes #8658 * fix: add missing bedrockOptions to loadConfiguration return type * Fix various issues that the original PR missed. * Remove debug logs * Rename AWS Bedrock -> Amazon Bedrock * Remove some 'as any's * Revert README changes * Add translations * More translations * Remove leftover code from a debugging session. * fix: add bedrock to codebaseIndexModelsSchema and update brace-expansion override - Add bedrock provider to codebaseIndexModelsSchema type definition to fix empty model dropdown in UI - Update pnpm override for brace-expansion from '>=2.0.2' to '^2.0.2' to resolve ESM/CommonJS compatibility issues * Improvements to AWS Bedrock embeddings support - Enhanced bedrock.ts embedder implementation - Added comprehensive test coverage in bedrock.spec.ts - Updated config-manager.ts for better Bedrock configuration handling - Improved service-factory.ts integration - Updated embeddingModels.ts with Bedrock models - Enhanced CodeIndexPopover.tsx UI for Bedrock options - Added auto-populate test for CodeIndexPopover - Updated pnpm-lock.yaml dependencies * Restore openrouter config * Remove debug log * Fix config-manager.spec.ts unit test. * Add translations for "optional" * Revert unnecessary change related to open ia embedder --------- Co-authored-by: Roo Code <[email protected]> Co-authored-by: Matt Rubens <[email protected]> Co-authored-by: Smartsheet-JB-Brown <[email protected]>
1 parent 3806b3d commit 56c630c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1861
-46
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ body:
7676
label: API Provider (optional)
7777
options:
7878
- Anthropic
79-
- AWS Bedrock
79+
- Amazon Bedrock
8080
- Chutes AI
8181
- DeepSeek
8282
- Featherless AI

.roo/rules-translate/instructions-zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115

116116
- 保留英文品牌名
117117
- 技术术语保持一致性
118-
- 保留英文专有名词:如"AWS Bedrock ARN"
118+
- 保留英文专有名词:如"Amazon Bedrock ARN"
119119

120120
4. **用户操作**
121121
- 操作动词统一:

CHANGELOG.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@
374374

375375
## [3.28.11] - 2025-09-29
376376

377-
- Fix: Correct AWS Bedrock Claude Sonnet 4.5 model identifier (#8371 by @sunhyung, PR by @app/roomote)
377+
- Fix: Correct Amazon Bedrock Claude Sonnet 4.5 model identifier (#8371 by @sunhyung, PR by @app/roomote)
378378
- Fix: Correct Claude Sonnet 4.5 model ID format (thanks @daniel-lxs!)
379379

380380
## [3.28.10] - 2025-09-29
@@ -706,7 +706,7 @@
706706
## [3.25.14] - 2025-08-13
707707

708708
- Fix: Only include verbosity parameter for models that support it (#7054 by @eastonmeth, PR by @app/roomote)
709-
- Fix: AWS Bedrock 1M context - Move anthropic_beta to additionalModelRequestFields (thanks @daniel-lxs!)
709+
- Fix: Amazon Bedrock 1M context - Move anthropic_beta to additionalModelRequestFields (thanks @daniel-lxs!)
710710
- Fix: Make cancelling requests more responsive by reverting recent changes
711711

712712
## [3.25.13] - 2025-08-12
@@ -1071,7 +1071,7 @@
10711071
- Add user-configurable search score threshold slider for semantic search (thanks @hannesrudolph!)
10721072
- Add default headers and testing for litellm fetcher (thanks @andrewshu2000!)
10731073
- Fix consistent cancellation error messages for thinking vs streaming phases
1074-
- Fix AWS Bedrock cross-region inference profile mapping (thanks @KevinZhao!)
1074+
- Fix Amazon Bedrock cross-region inference profile mapping (thanks @KevinZhao!)
10751075
- Fix URL loading timeout issues in @ mentions (thanks @MuriloFP!)
10761076
- Fix API retry exponential backoff capped at 10 minutes (thanks @MuriloFP!)
10771077
- Fix Qdrant URL field auto-filling with default value (thanks @SannidhyaSah!)
@@ -1085,7 +1085,7 @@
10851085
- Suppress Mermaid error rendering
10861086
- Improve Mermaid buttons with light background in light mode (thanks @chrarnoldus!)
10871087
- Add .vscode/ to write-protected files/directories
1088-
- Update AWS Bedrock cross-region inference profile mapping (thanks @KevinZhao!)
1088+
- Update Amazon Bedrock cross-region inference profile mapping (thanks @KevinZhao!)
10891089

10901090
## [3.22.5] - 2025-06-28
10911091

@@ -1709,7 +1709,7 @@
17091709
- Improved display of diff errors + easy copying for investigation
17101710
- Fixes to .vscodeignore (thanks @franekp!)
17111711
- Fix a zh-CN translation for model capabilities (thanks @zhangtony239!)
1712-
- Rename AWS Bedrock to Amazon Bedrock (thanks @ronyblum!)
1712+
- Rename Amazon Bedrock to Amazon Bedrock (thanks @ronyblum!)
17131713
- Update extension title and description (thanks @StevenTCramer!)
17141714

17151715
## [3.11.12] - 2025-04-09
@@ -1958,12 +1958,12 @@
19581958
- PowerShell-specific command handling (thanks @KJ7LNW!)
19591959
- OpenAI-compatible DeepSeek/QwQ reasoning support (thanks @lightrabbit!)
19601960
- Anthropic-style prompt caching in the OpenAI-compatible provider (thanks @dleen!)
1961-
- Add Deepseek R1 for AWS Bedrock (thanks @ATempsch!)
1961+
- Add Deepseek R1 for Amazon Bedrock (thanks @ATempsch!)
19621962
- Fix MarkdownBlock text color for Dark High Contrast theme (thanks @cannuri!)
19631963
- Add gemini-2.0-pro-exp-02-05 model to vertex (thanks @shohei-ihaya!)
19641964
- Bring back progress status for multi-diff edits (thanks @qdaxb!)
19651965
- Refactor alert dialog styles to use the correct vscode theme (thanks @cannuri!)
1966-
- Custom ARNs in AWS Bedrock (thanks @Smartsheet-JB-Brown!)
1966+
- Custom ARNs in Amazon Bedrock (thanks @Smartsheet-JB-Brown!)
19671967
- Update MCP servers directory path for platform compatibility (thanks @hannesrudolph!)
19681968
- Fix browser system prompt inclusion rules (thanks @cannuri!)
19691969
- Publish git tags to github from CI (thanks @pdecat!)
@@ -2101,7 +2101,7 @@
21012101

21022102
## [3.7.1] - 2025-02-24
21032103

2104-
- Add AWS Bedrock support for Sonnet 3.7 and update some defaults to Sonnet 3.7 instead of 3.5
2104+
- Add Amazon Bedrock support for Sonnet 3.7 and update some defaults to Sonnet 3.7 instead of 3.5
21052105

21062106
## [3.7.0] - 2025-02-24
21072107

@@ -2118,7 +2118,7 @@
21182118

21192119
## [3.3.24] - 2025-02-20
21202120

2121-
- Fixed a bug with region selection preventing AWS Bedrock profiles from being saved (thanks @oprstchn!)
2121+
- Fixed a bug with region selection preventing Amazon Bedrock profiles from being saved (thanks @oprstchn!)
21222122
- Updated the price of gpt-4o (thanks @marvijo-code!)
21232123

21242124
## [3.3.23] - 2025-02-20
@@ -2302,7 +2302,7 @@
23022302
- Reverts provider key entry back to checking onInput instead of onChange to hopefully address issues entering API keys (thanks @samhvw8!)
23032303
- Added explicit checkbox to use Azure for OpenAI compatible providers (thanks @samhvw8!)
23042304
- Fixed Glama usage reporting (thanks @punkpeye!)
2305-
- Added Llama 3.3 70B Instruct model to the AWS Bedrock provider options (thanks @Premshay!)
2305+
- Added Llama 3.3 70B Instruct model to the Amazon Bedrock provider options (thanks @Premshay!)
23062306

23072307
## [3.2.7]
23082308

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"tar-fs": ">=3.1.1",
5858
"esbuild": ">=0.25.0",
5959
"undici": ">=5.29.0",
60-
"brace-expansion": ">=2.0.2",
60+
"brace-expansion": "^2.0.2",
6161
"form-data": ">=4.0.4",
6262
"bluebird": ">=3.7.2",
6363
"glob": ">=11.1.0"

packages/types/src/codebase-index.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,16 @@ export const codebaseIndexConfigSchema = z.object({
2222
codebaseIndexEnabled: z.boolean().optional(),
2323
codebaseIndexQdrantUrl: z.string().optional(),
2424
codebaseIndexEmbedderProvider: z
25-
.enum(["openai", "ollama", "openai-compatible", "gemini", "mistral", "vercel-ai-gateway", "openrouter"])
25+
.enum([
26+
"openai",
27+
"ollama",
28+
"openai-compatible",
29+
"gemini",
30+
"mistral",
31+
"vercel-ai-gateway",
32+
"bedrock",
33+
"openrouter",
34+
])
2635
.optional(),
2736
codebaseIndexEmbedderBaseUrl: z.string().optional(),
2837
codebaseIndexEmbedderModelId: z.string().optional(),
@@ -36,6 +45,9 @@ export const codebaseIndexConfigSchema = z.object({
3645
// OpenAI Compatible specific fields
3746
codebaseIndexOpenAiCompatibleBaseUrl: z.string().optional(),
3847
codebaseIndexOpenAiCompatibleModelDimension: z.number().optional(),
48+
// Bedrock specific fields
49+
codebaseIndexBedrockRegion: z.string().optional(),
50+
codebaseIndexBedrockProfile: z.string().optional(),
3951
})
4052

4153
export type CodebaseIndexConfig = z.infer<typeof codebaseIndexConfigSchema>
@@ -52,6 +64,7 @@ export const codebaseIndexModelsSchema = z.object({
5264
mistral: z.record(z.string(), z.object({ dimension: z.number() })).optional(),
5365
"vercel-ai-gateway": z.record(z.string(), z.object({ dimension: z.number() })).optional(),
5466
openrouter: z.record(z.string(), z.object({ dimension: z.number() })).optional(),
67+
bedrock: z.record(z.string(), z.object({ dimension: z.number() })).optional(),
5568
})
5669

5770
export type CodebaseIndexModels = z.infer<typeof codebaseIndexModelsSchema>

pnpm-lock.yaml

Lines changed: 13 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/tools/BrowserActionTool.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,12 @@ export async function browserActionTool(
109109
// Do not close the browser on parameter validation errors
110110
return // can't be within an inner switch
111111
}
112-
112+
113113
// Get viewport dimensions from the browser session
114114
const viewportSize = cline.browserSession.getViewportSize()
115115
const viewportWidth = viewportSize.width || 900 // default to 900 if not available
116116
const viewportHeight = viewportSize.height || 600 // default to 600 if not available
117-
117+
118118
// Scale coordinate from image dimensions to viewport dimensions
119119
try {
120120
processedCoordinate = scaleCoordinate(coordinate, viewportWidth, viewportHeight)
@@ -143,7 +143,7 @@ export async function browserActionTool(
143143
return
144144
}
145145
}
146-
146+
147147
if (action === "resize") {
148148
if (!size) {
149149
cline.consecutiveMistakeCount++

src/core/webview/ClineProvider.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,6 +2084,8 @@ export class ClineProvider
20842084
codebaseIndexOpenAiCompatibleBaseUrl: codebaseIndexConfig?.codebaseIndexOpenAiCompatibleBaseUrl,
20852085
codebaseIndexSearchMaxResults: codebaseIndexConfig?.codebaseIndexSearchMaxResults,
20862086
codebaseIndexSearchMinScore: codebaseIndexConfig?.codebaseIndexSearchMinScore,
2087+
codebaseIndexBedrockRegion: codebaseIndexConfig?.codebaseIndexBedrockRegion,
2088+
codebaseIndexBedrockProfile: codebaseIndexConfig?.codebaseIndexBedrockProfile,
20872089
},
20882090
// Only set mdmCompliant if there's an actual MDM policy
20892091
// undefined means no MDM policy, true means compliant, false means non-compliant
@@ -2312,6 +2314,8 @@ export class ClineProvider
23122314
stateValues.codebaseIndexConfig?.codebaseIndexOpenAiCompatibleBaseUrl,
23132315
codebaseIndexSearchMaxResults: stateValues.codebaseIndexConfig?.codebaseIndexSearchMaxResults,
23142316
codebaseIndexSearchMinScore: stateValues.codebaseIndexConfig?.codebaseIndexSearchMinScore,
2317+
codebaseIndexBedrockRegion: stateValues.codebaseIndexConfig?.codebaseIndexBedrockRegion,
2318+
codebaseIndexBedrockProfile: stateValues.codebaseIndexConfig?.codebaseIndexBedrockProfile,
23152319
},
23162320
profileThresholds: stateValues.profileThresholds ?? {},
23172321
includeDiagnosticMessages: stateValues.includeDiagnosticMessages ?? true,

src/core/webview/webviewMessageHandler.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2378,6 +2378,8 @@ export const webviewMessageHandler = async (
23782378
codebaseIndexEmbedderModelId: settings.codebaseIndexEmbedderModelId,
23792379
codebaseIndexEmbedderModelDimension: settings.codebaseIndexEmbedderModelDimension, // Generic dimension
23802380
codebaseIndexOpenAiCompatibleBaseUrl: settings.codebaseIndexOpenAiCompatibleBaseUrl,
2381+
codebaseIndexBedrockRegion: settings.codebaseIndexBedrockRegion,
2382+
codebaseIndexBedrockProfile: settings.codebaseIndexBedrockProfile,
23812383
codebaseIndexSearchMaxResults: settings.codebaseIndexSearchMaxResults,
23822384
codebaseIndexSearchMinScore: settings.codebaseIndexSearchMinScore,
23832385
}

src/i18n/locales/ca/embeddings.json

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)