fix: enforce handoff delegation roles

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-03-21 21:13:16 +01:00
co-authored by Copilot
parent 8f668da7f8
commit f940b9d153
5 changed files with 132 additions and 5 deletions
+9
View File
@@ -81,4 +81,13 @@ describe('pattern validation', () => {
}).find((issue) => issue.field === 'agents')?.message,
).toBe('Group chat requires at least two agents.');
});
test('handoff builtin instructions clearly separate triage and specialist ownership', () => {
const handoff = createBuiltinPatterns(BUILTIN_TIMESTAMP).find((pattern) => pattern.mode === 'handoff');
expect(handoff).toBeDefined();
expect(handoff?.agents[0].instructions).toContain('Do not do the specialist work yourself');
expect(handoff?.agents[1].instructions).toContain('own the substantive answer');
expect(handoff?.agents[2].instructions).toContain('own the substantive answer');
});
});