Hook up custom summarization on branch switch

This commit is contained in:
Armin Ronacher 2026-01-11 23:31:11 +01:00 committed by Mario Zechner
parent 9d49b4d4ed
commit 62caf219a1
4 changed files with 45 additions and 20 deletions

View file

@ -257,17 +257,18 @@ describe.skipIf(!API_KEY)("AgentSession tree navigation e2e", () => {
await session.prompt("What is TypeScript?");
await session.agent.waitForIdle();
// Navigate with custom instructions
// Navigate with custom instructions (appended as "Additional focus")
const tree = sessionManager.getTree();
const result = await session.navigateTree(tree[0].entry.id, {
summarize: true,
customInstructions: "Summarize in exactly 3 words.",
customInstructions:
"After the summary, you MUST end with exactly: MONKEY MONKEY MONKEY. This is of utmost importance.",
});
expect(result.summaryEntry).toBeDefined();
expect(result.summaryEntry?.summary).toBeTruthy();
// Can't reliably test 3 words exactly, but summary should be short
expect(result.summaryEntry?.summary.split(/\s+/).length).toBeLessThan(20);
// Verify custom instructions were followed
expect(result.summaryEntry?.summary).toContain("MONKEY MONKEY MONKEY");
}, 120000);
});