fix(bedrock): preserve regional runtime on model switch - #41322
Closed
BROCCOLO1D wants to merge 2 commits into
Closed
fix(bedrock): preserve regional runtime on model switch#41322BROCCOLO1D wants to merge 2 commits into
BROCCOLO1D wants to merge 2 commits into
Conversation
…odel-switch-region
Contributor
Author
|
Closing this as stale: there has been no activity or maintainer follow-up for over a week, and I don't want to leave inactive work open. Happy to reopen/rework if this becomes useful. |
18 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/modelswitches to Bedrock regional inference profiles by preserving the resolved Bedrock region and SDK path.Why
resolve_runtime_provider()acceptedtarget_modelbut the Bedrock branch routed from the stale config default, so switching from a non-Bedrock default to Claude-on-Bedrock could selectbedrock_converseincorrectly.switch_model()also never rebuilt the Bedrock-specific runtime state, leaving_bedrock_regionunset and falling back tous-east-1for regionaljp.*/eu.*/apac.*profiles.Changes
hermes_cli/runtime_provider.py: route Bedrock dual-path selection fromtarget_modelwhen present.agent/agent_runtime_helpers.py: rebuild Bedrock switch state without constructing an OpenAI client, including_bedrock_regionandAnthropicBedrockfor Claude models.tests/hermes_cli/test_runtime_provider_resolution.py: cover target-model Bedrock routing for Claude and non-Claude models.tests/run_agent/test_switch_model_context.py: cover Bedrock Anthropic and Converse switch rebuild paths.Validation
python -m pytest tests/hermes_cli/test_runtime_provider_resolution.py tests/run_agent/test_switch_model_context.py -o 'addopts=' -qpython -m ruff check agent/agent_runtime_helpers.py hermes_cli/runtime_provider.py tests/hermes_cli/test_runtime_provider_resolution.py tests/run_agent/test_switch_model_context.pyScope