feat(project): add BedrockManagedAgents template support - #2484
Conversation
| To create an execution environment for Bedrock Managed Agents: | ||
|
|
||
| ```bash | ||
| agentcore create --name MyManagedAgent --template bedrock-managed-agents | ||
| ``` | ||
|
|
||
| Bedrock Managed Agents runs the agent loop and sends lifecycle and command requests to the | ||
| generated AgentCore Runtime. The Runtime is a container environment for Codex rather than an agent | ||
| that invokes a model itself, so it has no model-provider or memory configuration. Its dependencies | ||
| are installed when the container image is built. The generated Runtime README covers deployment, | ||
| the sample client, persistence, observability, and adding skills. | ||
|
|
There was a problem hiding this comment.
lets remove this from the readme since it's specific to this feature
|
Claude Security Review: no high-confidence findings. (run) |
| }, | ||
| "bedrock-managed-agents": { | ||
| runtimeName: "bedrock_managed_agents", | ||
| description: "Codex execution environment for Bedrock Managed Agents", |
There was a problem hiding this comment.
is it worded "codex execution environment" officially?
There was a problem hiding this comment.
I'll remove codex to be safe
There was a problem hiding this comment.
Actually I think it is throughout. Let's confirm if this was also the wording in the merge in main line
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## refactor #2484 +/- ##
==========================================
Coverage 97.39% 97.39%
==========================================
Files 638 642 +4
Lines 46622 46807 +185
==========================================
+ Hits 45406 45590 +184
- Misses 1216 1217 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Claude Security Review: no high-confidence findings. (run) |
notgitika
left a comment
There was a problem hiding this comment.
Great work! Left a comment which doesn't have to be addressed right away.
There was a problem hiding this comment.
https://docs.aws.amazon.com/bedrock/latest/userguide/inference-responses-api.html
Not sure if we'd wanna add some validation here but Mantle has a region allowlist. For instance I could put in us-west-1 which will result in failing sessions (create and deploy will pass). But adding this client side validation will result in us maintaining the code.
What do you think? Maybe we add it in our docs or in the scaffolded template readme? a statement like "Please verify you are using a supported region" and link to these docs
tejaskash
left a comment
There was a problem hiding this comment.
No actionable regressions found. All 3,949 tests passed, along with typechecking, linting, the CLI build, and the generated Docker build. Live BMA session behavior was not verified.
| @@ -0,0 +1,26 @@ | |||
| import type { RuntimeTemplateProfile } from "./templateProfile"; | |||
There was a problem hiding this comment.
more general comment, but is there a way to centralize the bma logic a single place? I feel like we're special casing in a few different places.
There was a problem hiding this comment.
For getting this up and running; the special casing was pretty necessary. This file holds as much centralized logic as made sense for a first pass. The special casing elsewhere is in cases where metadata is only available at that layer and not persisted, for example.
We likely could improve the centralization, but that's a separate effort from the generic support logic this PR holds imo.
| @@ -0,0 +1,69 @@ | |||
| # The CloudWatch agent runs this OpenTelemetry Collector configuration. It receives OTLP from | |||
There was a problem hiding this comment.
i thought runtime did some of this for us?
| supportsModelProviderOverride: false, | ||
| runtimeVersion: "NODE_22", | ||
| }, | ||
| "bedrock-managed-agents": { |
There was a problem hiding this comment.
my understanding is that this template is actually an execution environment for an agent, but this name suggests that it is itself an agent? Is this template also including some code to set up that agent?
There was a problem hiding this comment.
Yeah it is an exec env for the agent; not the agent itself. But the name does indicate the service that the template is supporting. I do see how it could be a bit confusing
| build: BuildTypeSchema, | ||
| language: z.enum(["Python", "TypeScript"]), | ||
| framework: z.enum(["strands", "langchain", "vercelai", "none"]), | ||
| framework: z.enum(["strands", "langchain", "vercelai", "bedrock-managed-agents", "none"]), |
There was a problem hiding this comment.
I'm not sure this fits as a framework.
| @@ -0,0 +1,35 @@ | |||
| import { isChinaRegion } from "../../../core/partition"; | |||
There was a problem hiding this comment.
how exactly is this change related to the goal of shipping the template?
There was a problem hiding this comment.
Before this PR, the region validation existed only in the CLI handlers. The TUI called ProjectManager.create(), which was sidestepping the CN region check completely. This wasn't only a BMA issue but a widespread one. Specifically for BMA, the CN checks are needed since bedrock/mantle isn't available in CN.
I added this file so we could use the logic to exercise the region checks in both CLI and TUI flows before calling create.
Description
Adds Bedrock Managed Agents (BMA) support to the v1 AgentCore CLI
Scaffold a BMA execution environment with:
bedrock-managed-agentsruntime template for CLI and TUI project creationlifecycle/server.pyentrypointType of Change
Testing
How have you tested the change?
bun run test(3949 pass, 0 fail)npm run test:unitandnpm run test:integnpm run typechecknpm run lintsrc/assets/, I rannpm run test:update-snapshotsand committed the updated snapshotsChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.