(args: {
db: ReturnType<typeof createTestDb>;
sessionId: string;
drop: string;
protectedTags?: number;
})
| 46 | } |
| 47 | |
| 48 | async function callDrop(args: { |
| 49 | db: ReturnType<typeof createTestDb>; |
| 50 | sessionId: string; |
| 51 | drop: string; |
| 52 | protectedTags?: number; |
| 53 | }) { |
| 54 | const tool = createCtxReduceTool({ |
| 55 | db: args.db, |
| 56 | protectedTags: args.protectedTags ?? 0, |
| 57 | }); |
| 58 | const result = await tool.execute( |
| 59 | "call-1", |
| 60 | { drop: args.drop }, |
| 61 | new AbortController().signal, |
| 62 | undefined, |
| 63 | fakeContext(args.sessionId) as never, |
| 64 | ); |
| 65 | const text = (result.content[0] as { text: string }).text; |
| 66 | return { result, text, isError: result.isError === true }; |
| 67 | } |
| 68 | |
| 69 | describe("Pi ctx_reduce tool", () => { |
| 70 | it("queues a drop for a known active tag", async () => { |
no test coverage detected