Repository navigation
Conversation
`agentcore add runtime --type create` no longer generates agent code. It creates app/<name>/ with a README.md and AGENTS.md describing exactly what the user's code needs (entry file, runtime contract per protocol, manifest, container flow), never overwriting existing files, and writes a complete runtime entry with starting values. dev, build and deploy now keep agentcore.json in sync with the code before running: a Dockerfile switches the runtime to Container, requires-python / engines.node constrain runtimeVersion (an allowed current value is kept), and the entrypoint comes from [tool.agentcore] / package.json "main". Changes are printed and written back; prechecks fail early with a pointer to the runtime's README. BREAKING CHANGE: `add runtime` drops --template, --model-provider, --model-id, --api-key and --api-base, and adds --language (required for --type create) and --protocol. Use `create --template` for starter code.
|
Claude Security Review: no high-confidence findings. (run) |
There was a problem hiding this comment.
AgentCore Harness Review
Verdict: Looks good
This is a sizeable but careful refactor. I did a focused pass on the files actually touched by this PR and didn't find anything that needs changing before merge.
Highlights worth calling out positively:
syncRuntimeBuildinsrc/core/project/runtimeBuild.tsis well scoped, patches the raw JSON (preserving unknown fields and key order), validates with the Zod schema before writing, and funnels every change throughdescribeChangefor consistent CLI output.- The rollback story in
addResourcefor docs-only runtimes (src/core/project/manager.tsx~L794–820) correctly distinguishes between "folder existed" and "we created it", trackswrittenas files are written, and never clobbers user files (skipExisting: true+wxflag inFsTreeNode.write). The ownership check viaappFolderOwnerprevents collisions with other runtimes/harnesses/evaluators. prepareRuntimesaggregates problems across runtimes before throwing — nicer UX than failing on the first bad runtime — and every message points atapp/<name>/README.md.- The hand-rolled TOML parser is intentionally minimal and limited to a documented single-line
[tool.agentcore] entrypoint = "..."/[project] requires-python = "..."form. Non-matching shapes (tool.agentcore.entrypoint = ...,agentcore = { ... }) are detected and warned rather than silently ignored. - The dev file-watcher reentrancy flag (
ownWritePendinginsrc/handlers/project/dev/index.ts) is a reasonable fix for the "our own write triggers another reload" cycle; a rapid double external edit could still print one spurious "Reloaded…" line, but that's purely cosmetic. - Tests in
runtimeBuild.test.ts,manager.test.ts("docs-only runtimes"), andtemplates/runtime.test.tsuse real temp directories (mkdtemp+rm) rather than fs mocks, which matches the repo guidance.
No required changes from me.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## refactor #2605 +/- ##
============================================
+ Coverage 96.58% 96.59% +0.01%
============================================
Files 700 702 +2
Lines 57639 58290 +651
============================================
+ Hits 55673 56308 +635
- Misses 1966 1982 +16 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
BREAKING CHANGE: `add runtime --type` is removed; import is selected by passing --agent-id.
|
Claude Security Review: no high-confidence findings. (run) |
…o CodeZip Switching to Container removes runtimeVersion and sets dockerfile, but the switch message, the missing-Dockerfile precheck and the runtime READMEs said only to set "build": "CodeZip". Following that fails schema validation (runtimeVersion required for CodeZip, dockerfile only for Container) before sync can run, so dev/build/deploy all stop. The messages now name every edit: set build, remove the container-only fields the runtime has, and add a runtimeVersion. Adds a round-trip test that follows the instructions and checks the result loads and syncs.
|
Claude Security Review: no high-confidence findings. (run) |
Description
agentcore add runtimestops generating agent code. Users (or their coding agent) write the code; the CLI documents exactly what it needs and keepsagentcore.jsonin sync with it.add runtimeapp/<name>/withREADME.mdandAGENTS.md, rendered for the chosen language and protocol: the expected entry file, the AgentCore runtime contract (ports,/invocations,/ping,/mcp, agent card, session headers),pyproject.toml(uv) /package.json(npm), env vars injected by memory/gateway/credentials, and the container flow. Points to the AgentCore SDKs and samples repo.app/<name>/exists, the user's files are kept and only missing docs are added. Rollback only removes files this command wrote (or the folder if it created it). Refuses a folder already owned by another runtime, harness or evaluator.build: CodeZip, latestruntimeVersionfor--language,entrypointmain.py/main.js,protocol, plus any infra flags. No dependency install.dev/build/deploykeepagentcore.jsonin sync with the code (newProjectManager.syncRuntimeBuilds, before synth / before starting dev):Dockerfilein the code folder switches the runtime to Container (one-way; a Container runtime whose Dockerfile disappears fails the precheck instead of silently flipping).requires-python/engines.nodeconstrainruntimeVersion: an allowed current value is kept; only a version the range excludes is replaced with the highest allowed one. No churn for existing projects (tested for every template, import, harness export and BMA).[tool.agentcore] entrypoint(Python) or package.json"main"(CodeZip TS; onlymain.ts/main.jshonoured since the bundler always buildsmain.ts, others are warned and ignored).There are no changes in the L3 CDK.
Testing
add runtime --nameflowAnd I then went in read the readme and agents.md and told my agent:
I want to add myslef a simple runtime agent here in this folder which I can then do local dev and deploy with agentcore cli. I want a bot that answers as though it is in a randomly selected year. use a random tool to calculate an appropriate year. GO!I confirmed it read the agents.md and used the python SDK and strands.
Then my agent created:
I tested dev a bunch. Then I changed my requies_python value in
pyproject.tomland that also updated the schema. I got this note in dev:realone: runtimeVersion PYTHON_3_14 -> PYTHON_3_12 (requires-python ">=3.10,<3.13" in app/realone/pyproject.toml)and it updated myagentcore.jsonNext, changed entrypoint file and also updated:
realone: entrypoint main.py -> app.py ([tool.agentcore] entrypoint in app/realone/pyproject.toml)deployed and invoke also worked:
