chore(release): v2.4.14 - Odin caller identity
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -534,6 +534,27 @@ describe("agenticChat loop (SDK mocked)", () => {
|
||||
expect(usageRows.length).toBe(2);
|
||||
});
|
||||
|
||||
it("injects the caller's identity into the system prompt", async () => {
|
||||
createMock.mockReset();
|
||||
createMock.mockResolvedValueOnce({
|
||||
stop_reason: "end_turn",
|
||||
content: [{ type: "text", text: "Ahoj." }],
|
||||
usage: { input_tokens: 10, output_tokens: 5 },
|
||||
});
|
||||
await agenticChat([{ role: "user", content: "Kdo jsem?" }], {
|
||||
userId: fixUserId,
|
||||
roleName: "viewer",
|
||||
permissions: ["attendance.record"],
|
||||
});
|
||||
const system: string = createMock.mock.calls[0][0].system;
|
||||
expect(system).toContain(`${FIX.first} ${FIX.last}`);
|
||||
expect(system).toContain(`user_id ${fixUserId}`);
|
||||
// Cleanup the usage row this extra fixture-user turn recorded.
|
||||
await prisma.ai_usage.deleteMany({
|
||||
where: { user_id: fixUserId, kind: "agent" },
|
||||
});
|
||||
});
|
||||
|
||||
it("a user without permissions gets NO tools passed to the model", async () => {
|
||||
createMock.mockReset();
|
||||
createMock.mockResolvedValueOnce({
|
||||
|
||||
Reference in New Issue
Block a user