Ensure agent titles persist synchronously during creation

This commit is contained in:
Mohamed Boudra
2025-12-02 10:13:59 +00:00
parent 6e259c37db
commit dfe4321051
10 changed files with 173 additions and 16 deletions
@@ -168,6 +168,22 @@ describe("AgentRegistry", () => {
expect(persisted?.title).toBe("Fix Login Bug");
});
test("setTitle throws when the agent record does not exist", async () => {
await expect(registry.setTitle("missing-agent", "Impossible"))
.rejects.toThrow("Agent missing-agent not found");
});
test("applySnapshot accepts explicit title overrides", async () => {
const agentId = "agent-override";
await registry.applySnapshot(
createManagedAgent({ id: agentId }),
{ title: "Provided Title" }
);
const record = await registry.get(agentId);
expect(record?.title).toBe("Provided Title");
});
test("applySnapshot preserves custom titles while updating metadata", async () => {
const agentId = "agent-3";
await registry.applySnapshot(