Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/project/bedrockAgentImport/translator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ test.each([
}).translate();

expect(plan.files[file]).toContain(
`MEMORY_ID = os.getenv("AGENTCORE_MEMORY_${"A".repeat(42)}MEMORY_ID")`,
`MEMORY_ID = os.getenv("MEMORY_${"A".repeat(42)}MEMORY_ID")`,
);
},
);
2 changes: 1 addition & 1 deletion src/core/project/manager.export.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ describe("FsProjectManager.exportHarness rendered tree", () => {
const result = await drain(subject.exportHarness(project, exportInput()));

const session = await Bun.file(join(result.agentPath, "memory", "session.py")).text();
expect(session).toContain('MEMORY_ID = os.getenv("AGENTCORE_MEMORY_CHAT_HISTORY_ID")');
expect(session).toContain('MEMORY_ID = os.getenv("MEMORY_CHAT_HISTORY_ID")');
expect(await Bun.file(join(result.agentPath, "main.py")).text()).toContain(
"from memory.session import get_memory_session_manager",
);
Expand Down
4 changes: 1 addition & 3 deletions src/core/project/manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,7 @@ describe("FsProjectManager.create", () => {
const session = await Bun.file(
join(directory, "example", "app", "agent_python_strands", "memory", "session.py"),
).text();
expect(session).toContain(
'MEMORY_ID = os.getenv("AGENTCORE_MEMORY_AGENT_PYTHON_STRANDSMEMORY_ID")',
);
expect(session).toContain('MEMORY_ID = os.getenv("MEMORY_AGENT_PYTHON_STRANDSMEMORY_ID")');
});

test("writes a deploy-ready agentcore.json registering the template agent", async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/core/project/templates/export.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ describe("mapHarnessToExportPlan memory", () => {
});

expect(result.hasMemory).toBe(true);
expect(result.context.memoryEnvVarName).toBe("AGENTCORE_MEMORY_CHAT_HISTORY_ID");
expect(result.context.memoryEnvVarName).toBe("MEMORY_CHAT_HISTORY_ID");
expect(result.context.memoryStrategies).toEqual(["SEMANTIC"]);
expect(result.context.actorId).toBe("actor-1");
expect(result.notes).toEqual([]);
Expand Down
8 changes: 6 additions & 2 deletions src/projectSchemas/memory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,13 @@ export const MemorySchema = z
});
export type Memory = z.infer<typeof MemorySchema>;

/** Derives the env var name the CDK backend injects with the deployed memory id. */
/**
* The env var the CDK backend sets on the runtime with the deployed memory id: `MEMORY_<NAME>_ID`, the
* memory name uppercased. This is the name the v0 CLI deployed, kept so v0 agent code keeps finding its
* memory after migration; @aws/agentcore-cdk sets the same name (aws/agentcore-l3-cdk-constructs#418).
*/
export function memoryEnvVarName(memoryName: string): string {
return `AGENTCORE_MEMORY_${memoryName.toUpperCase()}_ID`;
return `MEMORY_${memoryName.toUpperCase()}_ID`;
}

export function defaultMemoryName(runtimeName: string): string {
Expand Down
Loading