feat(templates): wire in memory to the runtime templates - #2116
feat(templates): wire in memory to the runtime templates#2116Hweinstock wants to merge 7 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor #2116 +/- ##
=========================================
Coverage 97.24% 97.24%
=========================================
Files 471 472 +1
Lines 28911 28978 +67
=========================================
+ Hits 28114 28181 +67
Misses 797 797 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
AgentCore Harness Review
Verdict: Looks good
I traced through the refactor and the new strands-http-python template. The extraction into templates/{project,runtime,harness,renderer,types,fsTree}.ts is coherent, the manager's addResource rollback semantics are preserved (mutating projectSpec in place is fine because it isn't written on the error path), the new fromTextFile correctly reads Dockerfile content from disk (so getHarnessTemplateResolver matches the old copyFile behavior, minus the pre-write existence check — the error is still thrown at write time via InputValidationError), and the manifest snapshot confirms memory/ is filtered out when --memory is not set.
Two very minor observations that are not blocking:
mergeSpecEntriesinsrc/core/project/templates/project.tsmergesruntimes/credentials/memoriesbut ignoresharnesses, even thoughSpecEntriesincludes it. Currently unreachable sincecreateProjectTreeonly invokes the runtime resolver, so the omission is harmless — worth fixing if a future template contributes harnesses at project-create time.src/assets/templates/strands-http-python/main.pyreferences apyJsonStrhelper ({{pyJsonStr inputSchema}}and{{pyJsonStr litellmAdditionalParams}}) that isn't registered inHandlebarsTemplateRenderer. Guarded behindinlineFunctionTools/litellmAdditionalParams, both of which are never set in the currentruntime.tscontext, so it's latent — but it will blow up the day someone flips those flags on.
Neither of these needs to hold up the merge.
|
Claude Security Review: no high-confidence findings. (run) |
|
Claude Security Review: no high-confidence findings. (run) |
1b25e3b to
f07f985
Compare
|
Claude Security Review: no high-confidence findings. (run) |
|
Claude Security Review: no high-confidence findings. (run) |
f07f985 to
9088f13
Compare
notgitika
left a comment
There was a problem hiding this comment.
pretty straightforward we are mostly just porting over what already exists on main so I don't wanna comment about improvements in the templates themselves that we can bring in later.
LGTM just 2 questions
|
|
||
| export const MEMORY_SHORTCUTS = { | ||
| none: (_runtimeName: string) => undefined, | ||
| short: (runtimeName: string): Memory => ({ |
There was a problem hiding this comment.
just wanna point out that this renames shortTerm / longAndShortTerm that exist in CLI main, so existing CLI commands fail. was that intended?
There was a problem hiding this comment.
oh good catch, I actually thought this is what was on main, let me swap it to match.
| export const MEMORY_SHORTCUTS = { | ||
| none: (_runtimeName: string) => undefined, | ||
| short: (runtimeName: string): Memory => ({ | ||
| name: `${runtimeName}Memory`, |
There was a problem hiding this comment.
I haven't fully confirmed this but just wanted to make sure that when we append "Memory" here we are staying under the character limit of the service API, which is 48 chars? can we make sure the runtimeName then stays 42 chars max?
once bitten, twice shy 😊
There was a problem hiding this comment.
good call! These are the types of edge cases that only someone who has implemented this before would know :)
|
Claude Security Review: no high-confidence findings. (run) |
|
Claude Security Review: no high-confidence findings. (run) |
notgitika
left a comment
There was a problem hiding this comment.
LGTM thanks for addressing comments :)
|
Claude Security Review: the review did not analyze this PR (model took 0 turns). See the run for details; a later push or re-run is needed. |
Dependent on #2099 (ignore this until that is merged)
Problem
Memory is currently hardcoded to none. The old CLI defaulted to a real memory, and allowed
none | longAndShort | shortoptions.Solutions
Testing
created a project with the memory template then deployed, verified the project and my cdk stack included a memory. Also verified the memory code was included in the asset rendering.
went to console and invoked it, and verified the memory was created.