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 <roomote@roocode.com>
This commit is contained in:
roomote[bot] 2025-12-17 20:20:36 -05:00 committed by GitHub
parent 45dbe4d028
commit f899de1f53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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