Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Oct 30, 2025

Related GitHub Issue

Closes: #8750

Roo Code Task Context (Optional)

No Roo Code task context for this PR

Description

Implements Global Inference support for Amazon Bedrock models that currently support it (Claude Sonnet 4, Claude Sonnet 4.5, Claude Haiku 4.5). Adds:

  • New constant BEDROCK_GLOBAL_INFERENCE_MODEL_IDS to declare supported models.
  • New settings flag awsUseGlobalInference (types and UI).
  • Provider logic in AwsBedrockHandler to prefix global. for supported models (takes precedence over cross‑region); parseBaseModelId strips the prefix.
  • UI toggle under Bedrock provider, shown only for supported models. Enabling Global Inference disables cross‑region.

Test Procedure

  • Unit tests:
    • cd src && npx vitest run api/providers/tests/bedrock.spec.ts api/providers/tests/bedrock-inference-profiles.spec.ts
    • cd webview-ui && npx vitest run
  • Manual:
    • In Settings → Providers → Bedrock, select a supported model (Sonnet 4 / 4.5 / Haiku 4.5).
    • Toggle “Use Global inference”. Cross‑region is disabled automatically.
    • Verify requests use global. and that parsing removes the prefix for model metadata.

Pre-Submission Checklist

  • Issue Linked
  • Scope limited to feature
  • Self-review completed
  • Tests pass locally
  • Documentation/i18n considered (English string added; other locales can be updated separately)
  • No breaking changes

Screenshots / Videos

No UI layout changes; adds one checkbox when applicable.

Documentation Updates

  • No documentation updates are required.

Additional Notes

  • Global Inference toggle only appears for models in BEDROCK_GLOBAL_INFERENCE_MODEL_IDS.

Get in Touch

@your-discord


Important

Adds global inference support for specific Amazon Bedrock models, updates UI and settings to enable and manage this feature.

  • Behavior:
    • Adds global inference support for Amazon Bedrock models (Claude Sonnet 4, Claude Sonnet 4.5, Claude Haiku 4.5) in bedrock.ts.
    • Introduces awsUseGlobalInference flag in provider-settings.ts to enable global inference.
    • Updates AwsBedrockHandler to prioritize global inference over cross-region inference.
  • UI:
    • Adds a toggle for global inference in Bedrock.tsx, disabling cross-region when enabled.
    • Updates localization files (settings.json) to include global inference descriptions.
  • Validation:
    • Ensures only supported models can enable global inference in bedrock.ts.

This description was created by Ellipsis for f87e1b9. You can customize this summary. It will automatically update as commits are pushed.

Copilot AI review requested due to automatic review settings October 30, 2025 22:40
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. UI/UX UI/UX related or focused labels Oct 30, 2025
@roomote
Copy link

roomote bot commented Oct 30, 2025

Code Review Summary

I've reviewed the changes in this PR and found no new issues.

Issues Found

  • Missing mutual exclusion in UI: The cross-region inference checkbox should also disable global inference when enabled, creating proper mutual exclusion between the two settings. Currently only one direction is handled.
  • Translation error in Hindi locale: The Hindi translation contains Gujarati script. The word "શ્રેષ્ઠ" should be "श्रेष्ठ" in Hindi (Devanagari script).

Follow Along on Roo Code Cloud

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for AWS Bedrock Global Inference profile routing, which enables automatic selection of optimal AWS regions for supported models. The feature is mutually exclusive with cross-region inference.

Key changes:

  • Added new configuration option awsUseGlobalInference for enabling Global Inference profiles
  • Introduced BEDROCK_GLOBAL_INFERENCE_MODEL_IDS constant listing supported models (Claude Sonnet 4, 4.5, and Haiku 4.5)
  • Implemented UI checkbox that appears conditionally for supported models and enforces mutual exclusivity with cross-region inference

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
webview-ui/src/i18n/locales/en/settings.json Added translation key for Global Inference checkbox label
webview-ui/src/components/settings/providers/Bedrock.tsx Added conditional UI checkbox for Global Inference with one-way mutual exclusion logic
src/api/providers/bedrock.ts Implemented Global Inference prefix (global.) application logic with precedence over cross-region inference
packages/types/src/providers/bedrock.ts Defined list of models supporting Global Inference
packages/types/src/provider-settings.ts Added awsUseGlobalInference boolean field to Bedrock schema
Comments suppressed due to low confidence (1)

webview-ui/src/components/settings/providers/Bedrock.tsx:167

  • The cross-region inference checkbox lacks reciprocal mutual exclusion logic. When enabling cross-region inference, it should also disable Global Inference (similar to how enabling Global Inference disables cross-region inference on lines 157-158). Update the onChange handler to: onChange={(checked: boolean) => { setApiConfigurationField('awsUseCrossRegionInference', checked); if (checked) setApiConfigurationField('awsUseGlobalInference', false); }}
			<Checkbox
				checked={apiConfiguration?.awsUseCrossRegionInference || false}
				onChange={handleInputChange("awsUseCrossRegionInference", noTransform)}>
				{t("settings:providers.awsCrossRegion")}
			</Checkbox>

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Oct 30, 2025
hannesrudolph and others added 2 commits October 30, 2025 17:48
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
@hannesrudolph hannesrudolph moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Oct 30, 2025
Copy link

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mutual exclusion issue has been resolved. However, there is still one open issue regarding the Hindi translation that needs to be addressed before approval.

@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR - Needs Preliminary Review size:M This PR changes 30-99 lines, ignoring generated files. UI/UX UI/UX related or focused

Projects

Status: PR [Needs Prelim Review]

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Global Inference for Bedrock models supported

2 participants