aws-samples / aws-samples/sample-autonomous-cloud-coding-agents

fix(compute): deliver the Haiku geo profile to ECS agents

Open
#811 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
143
Forks
46
Avg merge
3d 9h
Merged PRs (30d)
20

Description

## Problem

The ECS backend never sets `ANTHROPIC_DEFAULT_HAIKU_MODEL` in `cdk/src/constructs/ecs-agent-cluster.ts`. As a result, `agent/src/config.py` falls back to the hardcoded `us.anthropic.claude-haiku-4-5-20251001-v1:0` profile.

On deployments configured with a non-US `bedrockGeoRegion`, the ECS task role grants the resolved geography but the auxiliary model still calls the US profile. This can fail with `AccessDenied` and contradicts the `resolveBedrockGeoRegion` JSDoc in `cdk/src/constructs/bedrock-models.ts`, which says the main and auxiliary models cannot route through different geographies. The later `haikuInferenceProfileId` JSDoc records this ECS exception.

## Expected behavior

Pass the resolved `haikuInferenceProfileId` to the ECS container as `ANTHROPIC_DEFAULT_HAIKU_MODEL`, matching AgentCore and Lambda MicroVM delivery. Add a synth assertion for a non-US geography.

Refs #764

Contributor guide

Open the contributing guide

Research direction

Start in cdk/src/constructs/ecs-agent-cluster.ts and trace how the resolved haikuInferenceProfileId is delivered to ECS containers; compare the AgentCore and Lambda MicroVM delivery paths. Review the related JSDoc in cdk/src/constructs/bedrock-models.ts, then add a synth assertion for a non-US bedrockGeoRegion. Done means ECS sets ANTHROPIC_DEFAULT_HAIKU_MODEL to the resolved profile.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.