2
0
Эх сурвалжийг харах

fix: add userAgentAppId to Bedrock embedder for code indexing (#10166)

Adds userAgentAppId configuration to the BedrockRuntimeClient in the
code indexing embedder, matching the implementation pattern already
used in the main Bedrock API provider.

This enables proper user agent identification in CloudTrail AWS requests
when using Bedrock for code indexing embeddings.

Fixes #10165

Co-authored-by: Roo Code <[email protected]>
roomote[bot] 1 долоо хоног өмнө
parent
commit
f899de1f53

+ 2 - 0
src/services/code-index/embedders/bedrock.ts

@@ -8,6 +8,7 @@ import {
 	INITIAL_RETRY_DELAY_MS as INITIAL_DELAY_MS,
 	INITIAL_RETRY_DELAY_MS as INITIAL_DELAY_MS,
 } from "../constants"
 } from "../constants"
 import { getDefaultModelId } from "../../../shared/embeddingModels"
 import { getDefaultModelId } from "../../../shared/embeddingModels"
+import { Package } from "../../../shared/package"
 import { t } from "../../../i18n"
 import { t } from "../../../i18n"
 import { withValidationErrorHandling, formatEmbeddingError, HttpError } from "../shared/validation-helpers"
 import { withValidationErrorHandling, formatEmbeddingError, HttpError } from "../shared/validation-helpers"
 import { TelemetryEventName } from "@roo-code/types"
 import { TelemetryEventName } from "@roo-code/types"
@@ -40,6 +41,7 @@ export class BedrockEmbedder implements IEmbedder {
 		const credentials = this.profile ? fromIni({ profile: this.profile }) : fromEnv()
 		const credentials = this.profile ? fromIni({ profile: this.profile }) : fromEnv()
 
 
 		this.bedrockClient = new BedrockRuntimeClient({
 		this.bedrockClient = new BedrockRuntimeClient({
+			userAgentAppId: `RooCode#${Package.version}`,
 			region: this.region,
 			region: this.region,
 			credentials,
 			credentials,
 		})
 		})