mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-06 19:58:43 +02:00
fix: mark handoff triage-to-specialist edges as loop edges
The forward edges from triage to specialists participate in cycles (triage→specialist + specialist→triage), so they must be marked with isLoop, condition, and maxIterations to pass validation. Fixes the Handoff Support Flow template and scaffoldGraphForMode() for handoff mode. Updates the corresponding test expectation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -430,12 +430,10 @@ describe('workflow validation', () => {
|
||||
const loopEdges = graph.edges.filter((edge) => edge.isLoop);
|
||||
|
||||
expect(graph.nodes.map((node) => node.id)).toContain('agent-handoff-triage');
|
||||
expect(loopEdges).toHaveLength(1);
|
||||
expect(loopEdges[0]).toMatchObject({
|
||||
source: 'agent-handoff-specialist-1',
|
||||
target: 'agent-handoff-triage',
|
||||
maxIterations: 4,
|
||||
});
|
||||
// Both forward (triage→specialist) and return (specialist→triage) edges are loops
|
||||
expect(loopEdges).toHaveLength(2);
|
||||
expect(loopEdges.every((edge) => edge.maxIterations === 4)).toBe(true);
|
||||
expect(loopEdges.every((edge) => edge.condition?.type === 'always')).toBe(true);
|
||||
});
|
||||
|
||||
test('scaffolds group-chat mode with loop edges between agent nodes', () => {
|
||||
|
||||
Reference in New Issue
Block a user