Conversation
97aa7c6 to
a84c235
Compare
|
/strands review this PR and leave comments, do not make code changes |
Review SummaryI've completed a comprehensive review of this PR. Overall, this is a well-structured implementation that adds container support across the entire CLI lifecycle with good patterns and error handling. However, there are several areas that need attention before merging. Critical Issues
|
|
|
|
|
|
|
|
Testing & DocumentationMissing Test CoverageI couldn't find unit tests for the new container functionality: Files without test coverage:
Recommended test cases:
Documentation GapsThe following should be documented (in README, CONTRIBUTING, or inline):
Test Plan VerificationThe PR description mentions all tests pass (1235 passed, 21 skipped), which is great! However, adding specific container tests would increase confidence in this complex feature. |
Recommendations & Next StepsBefore Merging - Must Address
|
Coverage Report
|
notgitika
left a comment
There was a problem hiding this comment.
thanks for addressing comments. lgtm
- Add Container as a build type for agents (create, add, dev, deploy, invoke, package) - Add Dockerfile and dockerignore templates for Python container agents - Add container dev server with Docker build, run, volume mount, and hot-reload - Add container packaging with Docker runtime detection and validation - Add Docker prerequisite check and runtime detection utility - Wire userId (default: "default-user") through invoke flow for container auth - Log userId in invoke request logs - Upgrade vended @aws/agentcore-cdk to ^0.1.0-alpha.2 - Fix eslint require-await errors in codezip-dev-server and container packaging - Simplify BaseRenderer to use copyAndRenderDir for container templates
- Add buildType: 'CodeZip' to schema-mapper test baseConfig (merge artifact) - Revert @aws/agentcore-cdk to ^0.1.0-alpha.1 (alpha.2 not yet published; semver ^0.1.0-alpha.1 already covers alpha.2 once available)
- Add port comments to Dockerfile EXPOSE directive - Fix container runtime null check (info.runtime !== null) - Use path.join() in getDockerfilePath for cross-platform support - Use CONTAINER_RUNTIMES constant instead of hardcoded array - Change dynamic import to static import in container-dev-server - Check ports sequentially to avoid bind race conditions
…tibility In Container builds, the Python module loads at container startup before any request context exists. API-key-based providers use @requires_api_key which needs a workload access token only available within request context, causing ValueError at import time. Defer load_model() using lazy initialization in all affected templates: - Strands: get_or_create_agent() singleton - LangChain/LangGraph: get_or_create_model() singleton - Google ADK / OpenAI Agents: ensure_credentials_loaded() guard
b18692d to
2c2b079
Compare
aidandaly24
left a comment
There was a problem hiding this comment.
Approved, there are probably some things we should ensure we have in the e2e test like container cleanup after dev
|
|
||
| // Validate build type if provided | ||
| if (options.build) { | ||
| const buildResult = BuildTypeSchema.safeParse(options.build); |
There was a problem hiding this comment.
I wonder if since some of this code is duplicated we should eventually consolidate it somewhere. Just a thought not necessary for this PR.
| } | ||
|
|
||
| // Build locally | ||
| const imageName = `agentcore-package-${agentName}`; |
There was a problem hiding this comment.
Are we ever cleaning this up?
Summary
userId(default:default-user) through invoke for container runtime auth (runtimeUserIdheader)@aws/agentcore-cdkto^0.1.0-alpha.2require-awaiterrors in codezip-dev-server and container packagingDocumentation
PR: #340
Test plan
agentcore createwith Container build type generates correct project structureagentcore add agent --build Containeradds container agent configagentcore devbuilds and runs container with hot-reloadagentcore deploybuilds container image via CodeBuild, pushes to ECR, creates runtimeagentcore invokeworks for container agents (userId sent asdefault-user)agentcore packagepackages container source correctly