fix: add extraOptions prop to ModelPicker for Bedrock custom ARN

This commit is contained in:
Roo Code 2025-12-21 09:02:04 +00:00
parent 470501adb8
commit d8502d76b0
2 changed files with 29 additions and 0 deletions

View file

@ -825,6 +825,11 @@ const ApiOptions = ({
organizationAllowList={organizationAllowList}
simplifySettings={fromWelcomeView}
hidePricing
extraOptions={
selectedProvider === "bedrock"
? [{ value: "custom-arn", label: t("settings:labels.useCustomArn") }]
: undefined
}
/>
{selectedProvider === "bedrock" && selectedModelId === "custom-arn" && (

View file

@ -39,6 +39,11 @@ type ModelIdKey = keyof Pick<
| "apiModelId"
>
interface ExtraOption {
value: string
label: string
}
interface ModelPickerProps {
defaultModelId: string
models: Record<string, ModelInfo> | null
@ -55,6 +60,7 @@ interface ModelPickerProps {
errorMessage?: string
simplifySettings?: boolean
hidePricing?: boolean
extraOptions?: ExtraOption[]
}
export const ModelPicker = ({
@ -69,6 +75,7 @@ export const ModelPicker = ({
errorMessage,
simplifySettings,
hidePricing,
extraOptions,
}: ModelPickerProps) => {
const { t } = useAppTranslation()
@ -232,6 +239,23 @@ export const ModelPicker = ({
/>
</CommandItem>
))}
{extraOptions?.map((option) => (
<CommandItem
key={option.value}
value={option.value}
onSelect={onSelect}
data-testid={`model-option-${option.value}`}>
<span className="truncate" title={option.label}>
{option.label}
</span>
<Check
className={cn(
"size-4 p-0.5 ml-auto",
option.value === selectedModelId ? "opacity-100" : "opacity-0",
)}
/>
</CommandItem>
))}
</CommandGroup>
</CommandList>
{searchValue && !modelIds.includes(searchValue) && (