Skip to content

feat(templates): support containers for ts http runtime - #2159

Merged
Hweinstock merged 3 commits into
aws:refactorfrom
Hweinstock:feat/strands-ts-container
Sep 1, 2026
Merged

feat(templates): support containers for ts http runtime#2159
Hweinstock merged 3 commits into
aws:refactorfrom
Hweinstock:feat/strands-ts-container

Conversation

@Hweinstock

Copy link
Copy Markdown
Contributor

Problem

The strands ts template does not yet support container builds.

Solution

  • copy the dockerfile/dockerignore from mainline, and mirror the pattern done for the strands-py template. z

Testing / Verification

$ agentcore project create --name tsTest --template strands-ts --build Container
Creating project tree
Installing CDK dependencies with npm
Installing Node dependencies with npm
Initializing git repository
Created project 'tsTest' in ./tsTest
To deploy it: cd tsTest && agentcore project deploy

$ cd tsTest

$ agentcore project add runtime --name bob --template strands-ts --build Container --memory none
Reading project spec file at '[..]'
Scaffolding runtime in project
Installing Node dependencies with npm
Updating project spec file at '[..]'
added runtime 'bob' to 'tsTest'

$ agentcore project dev --mode headless --agent bob

[seperate terminal] 
$ curl -N -X POST http://localhost:8080/invocations \
    -H "Content-Type: application/json" -H "Accept: text/event-stream" \
    -H "X-Amzn-Bedrock-AgentCore-Runtime-Session-Id: <session-id>" \
    -d '{"prompt":"Say hello in exactly 3 words."}'
data: "Hello to"

data: " you!"

[back to original]
$ agentcore project dev
Created default deployment target: account 440744214761, region us-east-1 (agentcore/aws-targets.json)
Verifying AWS account 440744214761
Synthesizing CloudFormation templates
Deploying AgentCore-tsTest-default

went to console and invoked both created agents.

@github-actions github-actions Bot added the size/s PR size: S label Sep 1, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added agentcore-harness-reviewing AgentCore Harness review in progress claude-security-reviewing Claude Code /security-review in progress labels Sep 1, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Sep 1, 2026
@codecov-commenter

codecov-commenter commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.25%. Comparing base (27e3250) to head (e2b721c).

Additional details and impacted files
@@            Coverage Diff            @@
##           refactor    #2159   +/-   ##
=========================================
  Coverage     97.25%   97.25%           
=========================================
  Files           508      508           
  Lines         33902    33915   +13     
=========================================
+ Hits          32972    32985   +13     
  Misses          930      930           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@agentcore-devx-automation agentcore-devx-automation Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AgentCore Harness Review

Verdict: Looks good

Small, focused PR that mirrors the existing strands-python + --build Container pattern for TypeScript. The template resolver filter, buildRuntimeSpec's container branch (setting dockerfile: "Dockerfile" and omitting runtimeVersion), and the shortcut's runtimeVersion clearing when overriding to Container all line up correctly. The test coverage matches the existing hello-world-python-container style. Nothing blocking.

A few non-blocking observations the author may want to consider (not required for merge):

  • npm ci --omit=dev || npm install --omit=dev (Dockerfile.template L12) silently falls back to npm install when package-lock.json is missing, which produces a non-reproducible image without any warning. If reproducibility is desired, consider dropping the fallback and requiring the lockfile; if the fallback is intentional for the "no npm install was run first" case, an on-image message might help debuggability. Same convenience-vs-reproducibility tradeoff exists in the Python templates, so this is consistent.
  • No OTel wrapping in the container CMD: the Python container Dockerfiles wrap CMD with opentelemetry-instrument; this TS one runs npx tsx main.ts directly. That looks consistent with the current TS story (OTel isn't otherwise wired into the TS scaffold), so it's likely fine — just flagging in case OTel-for-TS-container is on the roadmap.
  • entrypoint: "main.js" in the spec while the Dockerfile CMD runs main.ts: harmless because agent.entrypoint isn't consulted on the Container deploy path, but slightly confusing to read. Nothing to change.

@agentcore-devx-automation agentcore-devx-automation Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Sep 1, 2026
@github-actions github-actions Bot added size/m PR size: M and removed size/s PR size: S labels Sep 1, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Sep 1, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Sep 1, 2026
@Hweinstock
Hweinstock force-pushed the feat/strands-ts-container branch from 069bb38 to e2b721c Compare September 1, 2026 19:20
@Hweinstock

Copy link
Copy Markdown
Contributor Author

responding to reviewer comments:

npm ci --omit=dev || npm install --omit=dev

This is a valid callout for inconsistency with python, addressed as a follow-up to generate the lock file on no-installs

No OTel wrapping in the container CMD

This is intentional since that wrapping is python specific. We will likely want to do something like what https://www.npmjs.com/package/@opentelemetry/auto-instrumentations-node provides, but for now we can mirror whats on mainline and already in production.

entrypoint: "main.js" in the spec

This is intentional, the dev command first tries main.ts, and fallsback to main.js if it is missing.

@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Sep 1, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Sep 1, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Sep 1, 2026
@Hweinstock

Copy link
Copy Markdown
Contributor Author

Known failing test: #2140

@Hweinstock
Hweinstock marked this pull request as ready for review September 1, 2026 19:39

@nborges-aws nborges-aws left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM no findings!

@Hweinstock
Hweinstock merged commit 89030dd into aws:refactor Sep 1, 2026
25 of 29 checks passed
@Hweinstock
Hweinstock deleted the feat/strands-ts-container branch September 2, 2026 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants