Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion agent/tools/research_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,12 @@ def _get_research_model(main_model: str) -> str:
if main_model.startswith("anthropic/"):
return "anthropic/claude-sonnet-4-6"
if main_model.startswith("bedrock/") and "anthropic" in main_model:
return "bedrock/us.anthropic.claude-sonnet-4-6"
# Mirror the main model's Bedrock inference-profile prefix so the
# user's explicit profile choice carries through to the sub-agent
# instead of being silently overridden by a hard-coded one.
head = main_model.split("/", 1)[1]
region_prefix = head.split(".", 1)[0]
return f"bedrock/{region_prefix}.anthropic.claude-sonnet-4-6"
# For non-Anthropic models (HF router etc.), use the same model
return main_model

Expand Down
11 changes: 11 additions & 0 deletions tests/unit/test_cli_rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ def test_bedrock_anthropic_research_model_stays_on_bedrock():
)


def test_bedrock_research_model_inherits_main_region_prefix():
assert (
_get_research_model("bedrock/global.anthropic.claude-opus-4-7")
== "bedrock/global.anthropic.claude-sonnet-4-6"
)
assert (
_get_research_model("bedrock/apac.anthropic.claude-sonnet-4-20250514-v1:0")
== "bedrock/apac.anthropic.claude-sonnet-4-6"
)


def test_non_anthropic_research_model_is_unchanged():
assert _get_research_model("openai/gpt-5.4") == "openai/gpt-5.4"

Expand Down
Loading