feat: Recompile system prompt after memory subagents finish (#1310)

This commit is contained in:
Devansh Jain
2026-03-09 16:50:40 -07:00
committed by GitHub
parent f5d6f095a6
commit 89d6ed2c87
9 changed files with 547 additions and 52 deletions

View File

@@ -0,0 +1,31 @@
import { describe, expect, mock, test } from "bun:test";
import { recompileAgentSystemPrompt } from "../../agent/modify";
describe("recompileAgentSystemPrompt", () => {
test("calls the Letta agent recompile endpoint with mapped params", async () => {
const agentsRecompileMock = mock(
(_agentId: string, _params?: Record<string, unknown>) =>
Promise.resolve("compiled-system-prompt"),
);
const client = {
agents: {
recompile: agentsRecompileMock,
},
};
const compiledPrompt = await recompileAgentSystemPrompt(
"agent-123",
{
updateTimestamp: true,
dryRun: true,
},
client,
);
expect(compiledPrompt).toBe("compiled-system-prompt");
expect(agentsRecompileMock).toHaveBeenCalledWith("agent-123", {
dry_run: true,
update_timestamp: true,
});
});
});