From 4e4904c3792a216a9e88aae503dd98849b7ab71d Mon Sep 17 00:00:00 2001 From: Jake Tracey Date: Mon, 15 Jun 2026 05:52:11 +1000 Subject: [PATCH] fix(bedrock): recognise au./apac. inference profiles to enable prompt caching is_anthropic_bedrock_model() strips a regional prefix before checking for "anthropic.claude" to route Claude through the AnthropicBedrock SDK path (prompt caching, thinking budgets) instead of the Converse path. The prefix list was missing "au." and "ap." does not match "apac.", so AU/APAC Claude inference profiles silently lost prompt caching. Add "apac." and "au.". Co-Authored-By: Claude Opus 4.8 (1M context) --- agent/bedrock_adapter.py | 2 +- tests/agent/test_bedrock_adapter.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/agent/bedrock_adapter.py b/agent/bedrock_adapter.py index 614f966e70c..e65867921c4 100644 --- a/agent/bedrock_adapter.py +++ b/agent/bedrock_adapter.py @@ -448,7 +448,7 @@ def is_anthropic_bedrock_model(model_id: str) -> bool: """ model_lower = model_id.lower() # Strip regional prefix if present - for prefix in ("us.", "global.", "eu.", "ap.", "jp."): + for prefix in ("us.", "global.", "eu.", "apac.", "ap.", "au.", "jp."): if model_lower.startswith(prefix): model_lower = model_lower[len(prefix):] break diff --git a/tests/agent/test_bedrock_adapter.py b/tests/agent/test_bedrock_adapter.py index afb7bbbc948..16d771d8806 100644 --- a/tests/agent/test_bedrock_adapter.py +++ b/tests/agent/test_bedrock_adapter.py @@ -1330,6 +1330,15 @@ class TestIsAnthropicBedrockModel: from agent.bedrock_adapter import is_anthropic_bedrock_model assert is_anthropic_bedrock_model("eu.anthropic.claude-sonnet-4-6") is True + def test_au_inference_profile(self): + from agent.bedrock_adapter import is_anthropic_bedrock_model + assert is_anthropic_bedrock_model("au.anthropic.claude-haiku-4-5-20251001-v1:0") is True + assert is_anthropic_bedrock_model("au.anthropic.claude-sonnet-4-6") is True + + def test_apac_inference_profile(self): + from agent.bedrock_adapter import is_anthropic_bedrock_model + assert is_anthropic_bedrock_model("apac.anthropic.claude-sonnet-4-6") is True + class TestEmptyTextBlockFix: """Test that empty/whitespace-only text blocks are replaced with a