feat: add approval checkpoints backend

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-03-24 19:48:58 +01:00
co-authored by Copilot
parent e7dfb66038
commit 2aa8d73b2d
28 changed files with 1471 additions and 23 deletions
+24
View File
@@ -101,4 +101,28 @@ describe('pattern validation', () => {
expect(groupChat?.agents[1].instructions).toContain('specific improvements');
expect(groupChat?.agents[1].instructions).toContain('instead of restarting the conversation');
});
test('approval policy rejects unknown agent references', () => {
const singlePattern = createBuiltinPatterns(BUILTIN_TIMESTAMP).find(
(pattern) => pattern.mode === 'single',
);
expect(singlePattern).toBeDefined();
const issues = validatePatternDefinition({
...singlePattern!,
approvalPolicy: {
rules: [
{
kind: 'tool-call',
agentIds: ['agent-missing'],
},
],
},
});
expect(issues.find((issue) => issue.field === 'approvalPolicy')?.message).toBe(
'Approval checkpoint "tool-call" references unknown agent "agent-missing".',
);
});
});