From 4bf909a8fd6c981ffaf9ddef33edbc50a04161cf Mon Sep 17 00:00:00 2001 From: ShotaroKataoka Date: Tue, 14 Jul 2026 12:14:12 +0900 Subject: [PATCH 1/8] =?UTF-8?q?=E2=9C=A8=20feat(add-gpt56-terra-luna-model?= =?UTF-8?q?s):=20add=20GPT-5.6=20Terra/Luna=20via=20bedrock-mantle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SPEC: 20260714-1210_add-gpt56-terra-luna-models - Terra: GPT-5.5-level performance at half cost, compose-capable - Luna: fastest/cheapest tier, chat only (compose_capable=False) - Both us-east-1/us-east-2/us-west-2, In-Region only (model IDs verified in AWS docs) Next: deploy agent stack and verify in Web UI --- agent/model_profiles.py | 8 ++++++++ infra/config.example.yaml | 2 ++ infra/lib/model-metadata.ts | 9 +++++++++ 3 files changed, 19 insertions(+) diff --git a/agent/model_profiles.py b/agent/model_profiles.py index ef6b21d4..47a2df98 100644 --- a/agent/model_profiles.py +++ b/agent/model_profiles.py @@ -92,6 +92,10 @@ def to_bedrock_kwargs(self) -> dict: # OpenAI GPT — bedrock-mantle only (Responses API endpoint). GPT_DEFAULT = ModelProfile(temperature=0.7, cache_strategy="none") +# OpenAI GPT fast tier (e.g. GPT-5.6 Luna) — same invocation params, but not +# capable enough for compose (Haiku-class positioning). +GPT_FAST = ModelProfile(temperature=0.7, cache_strategy="none", compose_capable=False) + # Fallback profile when a model id is not explicitly registered. _DEFAULT = CLAUDE_STANDARD @@ -99,6 +103,8 @@ def to_bedrock_kwargs(self) -> dict: # Models served via bedrock-mantle (OpenAI-compatible endpoint, not Converse API). # model_id → list of supported regions (first entry is the fallback). MANTLE_MODELS: dict[str, list[str]] = { + "openai.gpt-5.6-terra": ["us-east-1", "us-east-2", "us-west-2"], + "openai.gpt-5.6-luna": ["us-east-1", "us-east-2", "us-west-2"], "openai.gpt-5.5": ["us-east-1", "us-east-2"], "openai.gpt-5.4": ["us-east-1", "us-east-2", "us-west-2"], } @@ -136,6 +142,8 @@ def resolve_mantle_region(model_id: str, deploy_region: str | None = None) -> st # Amazon Nova "us.amazon.nova-2-lite-v1:0": NOVA_2_DEFAULT, # OpenAI GPT (bedrock-mantle) + "openai.gpt-5.6-terra": GPT_DEFAULT, + "openai.gpt-5.6-luna": GPT_FAST, "openai.gpt-5.5": GPT_DEFAULT, "openai.gpt-5.4": GPT_DEFAULT, } diff --git a/infra/config.example.yaml b/infra/config.example.yaml index 9f49aaa7..622c74b8 100644 --- a/infra/config.example.yaml +++ b/infra/config.example.yaml @@ -42,6 +42,8 @@ model: - "global.anthropic.claude-opus-4-6-v1" - "global.anthropic.claude-haiku-4-5-20251001-v1:0" - "us.amazon.nova-2-lite-v1:0" + - "openai.gpt-5.6-terra" # bedrock-mantle (us-east-1, us-east-2, us-west-2) + - "openai.gpt-5.6-luna" # bedrock-mantle (us-east-1, us-east-2, us-west-2), chat only - "openai.gpt-5.5" # bedrock-mantle (us-east-1, us-east-2) - "openai.gpt-5.4" # bedrock-mantle (us-east-1, us-east-2, us-west-2) diff --git a/infra/lib/model-metadata.ts b/infra/lib/model-metadata.ts index 6f202426..28321b23 100644 --- a/infra/lib/model-metadata.ts +++ b/infra/lib/model-metadata.ts @@ -50,6 +50,15 @@ export const MODEL_METADATA: Record = { composable: false, }, // --- OpenAI GPT --- + "openai.gpt-5.6-terra": { + displayName: "GPT-5.6 Terra", + description: "Balanced performance competitive with GPT-5.5 at half the cost", + }, + "openai.gpt-5.6-luna": { + displayName: "GPT-5.6 Luna", + description: "Fast and affordable, OpenAI's lowest cost tier", + composable: false, + }, "openai.gpt-5.5": { displayName: "GPT-5.5", description: "OpenAI's most capable model, advanced coding and agentic tasks", From 201125ff88aba473e478aa6bd12a932df7c4f276 Mon Sep 17 00:00:00 2001 From: ShotaroKataoka Date: Tue, 14 Jul 2026 12:36:48 +0900 Subject: [PATCH 2/8] =?UTF-8?q?=F0=9F=94=A7=20config(add-gpt56-terra-luna-?= =?UTF-8?q?models):=20enable=20compose=20for=20Luna=20(feasibility=20test)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SPEC: 20260714-1210_add-gpt56-terra-luna-models Luna is Haiku-class; enabling create picker to evaluate slide-generation feasibility. Revert to GPT_FAST if quality is insufficient. --- agent/model_profiles.py | 2 +- infra/lib/model-metadata.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/agent/model_profiles.py b/agent/model_profiles.py index 47a2df98..2b29f078 100644 --- a/agent/model_profiles.py +++ b/agent/model_profiles.py @@ -143,7 +143,7 @@ def resolve_mantle_region(model_id: str, deploy_region: str | None = None) -> st "us.amazon.nova-2-lite-v1:0": NOVA_2_DEFAULT, # OpenAI GPT (bedrock-mantle) "openai.gpt-5.6-terra": GPT_DEFAULT, - "openai.gpt-5.6-luna": GPT_FAST, + "openai.gpt-5.6-luna": GPT_DEFAULT, # compose enabled for feasibility testing "openai.gpt-5.5": GPT_DEFAULT, "openai.gpt-5.4": GPT_DEFAULT, } diff --git a/infra/lib/model-metadata.ts b/infra/lib/model-metadata.ts index 28321b23..e4cfaf7e 100644 --- a/infra/lib/model-metadata.ts +++ b/infra/lib/model-metadata.ts @@ -57,7 +57,6 @@ export const MODEL_METADATA: Record = { "openai.gpt-5.6-luna": { displayName: "GPT-5.6 Luna", description: "Fast and affordable, OpenAI's lowest cost tier", - composable: false, }, "openai.gpt-5.5": { displayName: "GPT-5.5", From f4b7cc64457677839ab9bbb979fff028fdc037c4 Mon Sep 17 00:00:00 2001 From: ShotaroKataoka Date: Tue, 14 Jul 2026 13:34:05 +0900 Subject: [PATCH 3/8] =?UTF-8?q?=F0=9F=90=9B=20fix(add-gpt56-terra-luna-mod?= =?UTF-8?q?els):=20add=20missing=20errors.py=20to=20agent=20Dockerfile=20C?= =?UTF-8?q?OPY?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Runtime failed to start (HTTP 424, ModuleNotFoundError: errors). errors.py existed in the repo but was never added to the Dockerfile COPY list; this deploy was the first image build since its introduction. --- agent/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/Dockerfile b/agent/Dockerfile index 90c4ff5e..69088234 100644 --- a/agent/Dockerfile +++ b/agent/Dockerfile @@ -13,7 +13,7 @@ RUN uv pip install --no-cache -r requirements.txt RUN useradd -m -u 1000 bedrock_agentcore USER bedrock_agentcore -COPY basic_agent.py cost_logger.py factory.py composition.py mcp_clients.py mantle_client.py model_profiles.py resilience.py session.py streaming.py ./ +COPY basic_agent.py cost_logger.py errors.py factory.py composition.py mcp_clients.py mantle_client.py model_profiles.py resilience.py session.py streaming.py ./ COPY prompts/ prompts/ COPY modes/ modes/ COPY tools/ tools/ From 24fdc8b0675122c81a986e8782a301c72d5d7f0f Mon Sep 17 00:00:00 2001 From: ShotaroKataoka Date: Tue, 14 Jul 2026 14:16:30 +0900 Subject: [PATCH 4/8] =?UTF-8?q?=F0=9F=90=9B=20fix(add-gpt56-terra-luna-mod?= =?UTF-8?q?els):=20route=20GPT-5.6=20via=20Responses=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GPT-5.6 model cards: Responses ✅ / Chat Completions ❌ — the legacy OpenAIModel path hit /chat/completions and got 400 Bad Request. Use strands OpenAIResponsesModel with native bedrock_mantle_config (bearer token per request); bump strands-agents floor to 1.47.0. Verified locally: Terra replies in 1.8s via mantle us-east-1. Known issue: Luna hangs (launch-week instability, community reports). --- agent/mantle_client.py | 18 +++++++++++++++++- agent/model_profiles.py | 8 ++++++++ agent/requirements.txt | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/agent/mantle_client.py b/agent/mantle_client.py index 103ca0b4..a65e7282 100644 --- a/agent/mantle_client.py +++ b/agent/mantle_client.py @@ -40,12 +40,28 @@ async def aclose(self): def mantle_model(model_id: str, region: str = "us-east-1"): - """Create a Strands OpenAIModel pointing at bedrock-mantle with SigV4 auth. + """Create a Strands model pointing at bedrock-mantle with AWS-native auth. + + Models that only support the Responses API (see + ``model_profiles.MANTLE_RESPONSES_MODELS``, e.g. GPT-5.6 Terra/Luna) use + Strands' native ``OpenAIResponsesModel`` with ``bedrock_mantle_config`` + (bearer token minted per request). All other models use the legacy + Chat Completions path with a SigV4-signed httpx transport. Usage: from mantle_client import mantle_model model = mantle_model("openai.gpt-5.4", region="us-east-1") """ + from model_profiles import MANTLE_RESPONSES_MODELS + + if model_id in MANTLE_RESPONSES_MODELS: + from strands.models.openai_responses import OpenAIResponsesModel + + return OpenAIResponsesModel( + bedrock_mantle_config={"region": region}, + model_id=model_id, + ) + from strands.models.openai import OpenAIModel class _MantleOpenAIModel(OpenAIModel): diff --git a/agent/model_profiles.py b/agent/model_profiles.py index 2b29f078..3f3b0bce 100644 --- a/agent/model_profiles.py +++ b/agent/model_profiles.py @@ -109,6 +109,14 @@ def to_bedrock_kwargs(self) -> dict: "openai.gpt-5.4": ["us-east-1", "us-east-2", "us-west-2"], } +# Mantle models that only support the Responses API (no Chat Completions). +# GPT-5.6 model cards: Responses ✅ / Chat Completions ❌ — calling +# /chat/completions returns 400 Bad Request. +MANTLE_RESPONSES_MODELS: set[str] = { + "openai.gpt-5.6-terra", + "openai.gpt-5.6-luna", +} + def resolve_mantle_region(model_id: str, deploy_region: str | None = None) -> str: """Resolve the best mantle region for a model. diff --git a/agent/requirements.txt b/agent/requirements.txt index b558e073..b6fd1fb9 100644 --- a/agent/requirements.txt +++ b/agent/requirements.txt @@ -1,6 +1,6 @@ # Dependencies for Strands Agent. AI model access requires appropriate # IAM permissions and Bedrock model access grants. -strands-agents[otel,openai]>=1.30.0 +strands-agents[otel,openai]>=1.47.0 mcp>=1.23.1 bedrock-agentcore[strands-agents]>=1.0.6 aws-opentelemetry-distro>=0.10.0 From 14abe2e1628ef99f6d1d97bfe5b88738e9f26491 Mon Sep 17 00:00:00 2001 From: ShotaroKataoka Date: Tue, 14 Jul 2026 14:55:19 +0900 Subject: [PATCH 5/8] =?UTF-8?q?=F0=9F=90=9B=20fix(add-gpt56-terra-luna-mod?= =?UTF-8?q?els):=20grant=20bedrock-mantle:CallWithBearerToken=20to=20agent?= =?UTF-8?q?=20role?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Responses API path uses bearer-token auth (not SigV4), which requires a separate IAM action. Runtime got 401 access_denied on Terra invocation. --- infra/lib/agent-stack.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/infra/lib/agent-stack.ts b/infra/lib/agent-stack.ts index 791e85c5..6216ab74 100644 --- a/infra/lib/agent-stack.ts +++ b/infra/lib/agent-stack.ts @@ -65,10 +65,12 @@ export class AgentStack extends cdk.Stack { resources: ["*"], }) ); - // bedrock-mantle (OpenAI-compatible endpoint) for models like GPT-5.4/5.5 + // bedrock-mantle (OpenAI-compatible endpoint) for models like GPT-5.4/5.5/5.6. + // CreateInference: legacy SigV4 path (Chat Completions). + // CallWithBearerToken: Responses API path (bearer token, e.g. GPT-5.6 Terra/Luna). role.addToPolicy( new iam.PolicyStatement({ - actions: ["bedrock-mantle:CreateInference"], + actions: ["bedrock-mantle:CreateInference", "bedrock-mantle:CallWithBearerToken"], resources: ["*"], }) ); From 5510be9a62400a2439aee07d20354144fc7c6cc0 Mon Sep 17 00:00:00 2001 From: ShotaroKataoka Date: Tue, 14 Jul 2026 22:41:40 +0900 Subject: [PATCH 6/8] =?UTF-8?q?=F0=9F=90=9B=20fix(add-gpt56-terra-luna-mod?= =?UTF-8?q?els):=20route=20Luna=20via=20us-east-2=20(us-east-1=20mantle=20?= =?UTF-8?q?stream=20stalls)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause of Luna hanging: region-specific fault in us-east-1 bedrock-mantle Luna deployment — stream emits 2 events then stalls indefinitely (25 min for a 1-word reply). us-east-2 / us-west-2 complete in <1s. Terra unaffected in all regions. Verified multi-turn tool round-trip on us-east-2: 3.2s total. --- agent/model_profiles.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/agent/model_profiles.py b/agent/model_profiles.py index 3f3b0bce..cfa81805 100644 --- a/agent/model_profiles.py +++ b/agent/model_profiles.py @@ -104,7 +104,10 @@ def to_bedrock_kwargs(self) -> dict: # model_id → list of supported regions (first entry is the fallback). MANTLE_MODELS: dict[str, list[str]] = { "openai.gpt-5.6-terra": ["us-east-1", "us-east-2", "us-west-2"], - "openai.gpt-5.6-luna": ["us-east-1", "us-east-2", "us-west-2"], + # Luna: us-east-2 first — us-east-1 mantle streaming stalls mid-response + # (verified 2026-07-14: us-east-1 stream emits 2 events then hangs; + # us-east-2 / us-west-2 complete in <1s). Revisit after AWS fixes it. + "openai.gpt-5.6-luna": ["us-east-2", "us-west-2", "us-east-1"], "openai.gpt-5.5": ["us-east-1", "us-east-2"], "openai.gpt-5.4": ["us-east-1", "us-east-2", "us-west-2"], } From df94e0de46d4951aebfb2635f4444654121ec737 Mon Sep 17 00:00:00 2001 From: ShotaroKataoka Date: Tue, 14 Jul 2026 23:00:19 +0900 Subject: [PATCH 7/8] =?UTF-8?q?=F0=9F=94=A7=20config(add-gpt56-terra-luna-?= =?UTF-8?q?models):=20Luna=20back=20to=20chat-only=20after=20feasibility?= =?UTF-8?q?=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Feasibility verdict (2026-07-14, Web UI): - Terra: acceptable slide generation quality — stays compose-capable - Luna: insufficient quality for compose — chat-only (GPT_FAST), consistent with its Haiku-class positioning --- agent/model_profiles.py | 2 +- infra/lib/model-metadata.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/agent/model_profiles.py b/agent/model_profiles.py index cfa81805..82100b59 100644 --- a/agent/model_profiles.py +++ b/agent/model_profiles.py @@ -154,7 +154,7 @@ def resolve_mantle_region(model_id: str, deploy_region: str | None = None) -> st "us.amazon.nova-2-lite-v1:0": NOVA_2_DEFAULT, # OpenAI GPT (bedrock-mantle) "openai.gpt-5.6-terra": GPT_DEFAULT, - "openai.gpt-5.6-luna": GPT_DEFAULT, # compose enabled for feasibility testing + "openai.gpt-5.6-luna": GPT_FAST, # feasibility-tested 2026-07-14: insufficient for compose "openai.gpt-5.5": GPT_DEFAULT, "openai.gpt-5.4": GPT_DEFAULT, } diff --git a/infra/lib/model-metadata.ts b/infra/lib/model-metadata.ts index e4cfaf7e..28321b23 100644 --- a/infra/lib/model-metadata.ts +++ b/infra/lib/model-metadata.ts @@ -57,6 +57,7 @@ export const MODEL_METADATA: Record = { "openai.gpt-5.6-luna": { displayName: "GPT-5.6 Luna", description: "Fast and affordable, OpenAI's lowest cost tier", + composable: false, }, "openai.gpt-5.5": { displayName: "GPT-5.5", From 74e71f5ed2b1fb6a65df65de8de523f612541846 Mon Sep 17 00:00:00 2001 From: ShotaroKataoka Date: Tue, 14 Jul 2026 23:01:58 +0900 Subject: [PATCH 8/8] =?UTF-8?q?=F0=9F=A7=B9=20cleanup(add-gpt56-terra-luna?= =?UTF-8?q?-models):=20remove=20Luna=20entirely=20after=20feasibility=20te?= =?UTF-8?q?st?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Verdict: Terra acceptable (stays, chat+create). Luna insufficient even for chat — removed from profiles, mantle registry, UI metadata, config. --- agent/mantle_client.py | 2 +- agent/model_profiles.py | 10 ---------- infra/config.example.yaml | 1 - infra/lib/agent-stack.ts | 2 +- infra/lib/model-metadata.ts | 5 ----- 5 files changed, 2 insertions(+), 18 deletions(-) diff --git a/agent/mantle_client.py b/agent/mantle_client.py index a65e7282..01237c17 100644 --- a/agent/mantle_client.py +++ b/agent/mantle_client.py @@ -43,7 +43,7 @@ def mantle_model(model_id: str, region: str = "us-east-1"): """Create a Strands model pointing at bedrock-mantle with AWS-native auth. Models that only support the Responses API (see - ``model_profiles.MANTLE_RESPONSES_MODELS``, e.g. GPT-5.6 Terra/Luna) use + ``model_profiles.MANTLE_RESPONSES_MODELS``, e.g. GPT-5.6 Terra) use Strands' native ``OpenAIResponsesModel`` with ``bedrock_mantle_config`` (bearer token minted per request). All other models use the legacy Chat Completions path with a SigV4-signed httpx transport. diff --git a/agent/model_profiles.py b/agent/model_profiles.py index 82100b59..416287fa 100644 --- a/agent/model_profiles.py +++ b/agent/model_profiles.py @@ -92,10 +92,6 @@ def to_bedrock_kwargs(self) -> dict: # OpenAI GPT — bedrock-mantle only (Responses API endpoint). GPT_DEFAULT = ModelProfile(temperature=0.7, cache_strategy="none") -# OpenAI GPT fast tier (e.g. GPT-5.6 Luna) — same invocation params, but not -# capable enough for compose (Haiku-class positioning). -GPT_FAST = ModelProfile(temperature=0.7, cache_strategy="none", compose_capable=False) - # Fallback profile when a model id is not explicitly registered. _DEFAULT = CLAUDE_STANDARD @@ -104,10 +100,6 @@ def to_bedrock_kwargs(self) -> dict: # model_id → list of supported regions (first entry is the fallback). MANTLE_MODELS: dict[str, list[str]] = { "openai.gpt-5.6-terra": ["us-east-1", "us-east-2", "us-west-2"], - # Luna: us-east-2 first — us-east-1 mantle streaming stalls mid-response - # (verified 2026-07-14: us-east-1 stream emits 2 events then hangs; - # us-east-2 / us-west-2 complete in <1s). Revisit after AWS fixes it. - "openai.gpt-5.6-luna": ["us-east-2", "us-west-2", "us-east-1"], "openai.gpt-5.5": ["us-east-1", "us-east-2"], "openai.gpt-5.4": ["us-east-1", "us-east-2", "us-west-2"], } @@ -117,7 +109,6 @@ def to_bedrock_kwargs(self) -> dict: # /chat/completions returns 400 Bad Request. MANTLE_RESPONSES_MODELS: set[str] = { "openai.gpt-5.6-terra", - "openai.gpt-5.6-luna", } @@ -154,7 +145,6 @@ def resolve_mantle_region(model_id: str, deploy_region: str | None = None) -> st "us.amazon.nova-2-lite-v1:0": NOVA_2_DEFAULT, # OpenAI GPT (bedrock-mantle) "openai.gpt-5.6-terra": GPT_DEFAULT, - "openai.gpt-5.6-luna": GPT_FAST, # feasibility-tested 2026-07-14: insufficient for compose "openai.gpt-5.5": GPT_DEFAULT, "openai.gpt-5.4": GPT_DEFAULT, } diff --git a/infra/config.example.yaml b/infra/config.example.yaml index 622c74b8..20a08263 100644 --- a/infra/config.example.yaml +++ b/infra/config.example.yaml @@ -43,7 +43,6 @@ model: - "global.anthropic.claude-haiku-4-5-20251001-v1:0" - "us.amazon.nova-2-lite-v1:0" - "openai.gpt-5.6-terra" # bedrock-mantle (us-east-1, us-east-2, us-west-2) - - "openai.gpt-5.6-luna" # bedrock-mantle (us-east-1, us-east-2, us-west-2), chat only - "openai.gpt-5.5" # bedrock-mantle (us-east-1, us-east-2) - "openai.gpt-5.4" # bedrock-mantle (us-east-1, us-east-2, us-west-2) diff --git a/infra/lib/agent-stack.ts b/infra/lib/agent-stack.ts index 6216ab74..30fbaf78 100644 --- a/infra/lib/agent-stack.ts +++ b/infra/lib/agent-stack.ts @@ -67,7 +67,7 @@ export class AgentStack extends cdk.Stack { ); // bedrock-mantle (OpenAI-compatible endpoint) for models like GPT-5.4/5.5/5.6. // CreateInference: legacy SigV4 path (Chat Completions). - // CallWithBearerToken: Responses API path (bearer token, e.g. GPT-5.6 Terra/Luna). + // CallWithBearerToken: Responses API path (bearer token, e.g. GPT-5.6 Terra). role.addToPolicy( new iam.PolicyStatement({ actions: ["bedrock-mantle:CreateInference", "bedrock-mantle:CallWithBearerToken"], diff --git a/infra/lib/model-metadata.ts b/infra/lib/model-metadata.ts index 28321b23..22d9963f 100644 --- a/infra/lib/model-metadata.ts +++ b/infra/lib/model-metadata.ts @@ -54,11 +54,6 @@ export const MODEL_METADATA: Record = { displayName: "GPT-5.6 Terra", description: "Balanced performance competitive with GPT-5.5 at half the cost", }, - "openai.gpt-5.6-luna": { - displayName: "GPT-5.6 Luna", - description: "Fast and affordable, OpenAI's lowest cost tier", - composable: false, - }, "openai.gpt-5.5": { displayName: "GPT-5.5", description: "OpenAI's most capable model, advanced coding and agentic tasks",