Bug
When the main model is a bedrock/ Anthropic profile, the research sub-agent forces a us. inference-profile prefix regardless of what the user chose for the main model. This breaks the sub-agent for any user whose AWS account/region cannot call the us.* cross-region profile, with:
Research sub-agent LLM error: litellm.BadRequestError: BedrockException -
{"message":"The provided model identifier is invalid."}
Cause
agent/tools/research_tool.py:225 hard-codes the prefix:
if main_model.startswith("bedrock/") and "anthropic" in main_model:
return "bedrock/us.anthropic.claude-sonnet-4-6"
AWS Bedrock exposes the same Sonnet profile under multiple prefixes (us., apac., global., ...); only us. is hard-coded here. The main agent passes the user-chosen profile through to LiteLLM unmodified, so it works — only the sub-agent overrides it.
Reproduction
- AWS region without access to
us.* Anthropic inference profiles (e.g. ap-northeast-1).
- Set the main model to a non-
us. Bedrock Anthropic profile, e.g. /model bedrock/global.anthropic.claude-opus-4-7.
- Send any prompt that triggers the research tool. The sub-agent fails with the error above; the main agent itself is unaffected.
Confirmed with a direct LiteLLM call from ap-northeast-1:
bedrock/us.anthropic.claude-sonnet-4-6 -> BedrockException "The provided model identifier is invalid."
bedrock/jp.anthropic.claude-sonnet-4-6 -> OK
Fix
Make the sub-agent inherit the prefix from the main model rather than overriding it. The cheaper sub-agent model name (claude-sonnet-4-6) is preserved; only the prefix follows the main agent's choice. PR: #185.
Bug
When the main model is a
bedrock/Anthropic profile, the research sub-agent forces aus.inference-profile prefix regardless of what the user chose for the main model. This breaks the sub-agent for any user whose AWS account/region cannot call theus.*cross-region profile, with:Cause
agent/tools/research_tool.py:225hard-codes the prefix:AWS Bedrock exposes the same Sonnet profile under multiple prefixes (
us.,apac.,global., ...); onlyus.is hard-coded here. The main agent passes the user-chosen profile through to LiteLLM unmodified, so it works — only the sub-agent overrides it.Reproduction
us.*Anthropic inference profiles (e.g.ap-northeast-1).us.Bedrock Anthropic profile, e.g./model bedrock/global.anthropic.claude-opus-4-7.Confirmed with a direct LiteLLM call from
ap-northeast-1:Fix
Make the sub-agent inherit the prefix from the main model rather than overriding it. The cheaper sub-agent model name (
claude-sonnet-4-6) is preserved; only the prefix follows the main agent's choice. PR: #185.