feat: enable edge deletion in group-chat mode

Extend edge deletion to group-chat orchestrator↔agent edges in addition
to handoff agent↔agent edges. Structural edges (user-input/output,
distributor/collector) remain non-deletable across all modes.

Sequential, concurrent, and single modes keep fully structural topologies
with no user-deletable edges.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-03-24 23:34:38 +01:00
co-authored by Copilot
parent 24bbf1ded3
commit f0d7d44589
3 changed files with 43 additions and 22 deletions
+16 -2
View File
@@ -226,11 +226,11 @@ describe('sequential reorder', () => {
});
describe('edge deletion rules', () => {
test('only handoff mode allows edge deletion', () => {
test('handoff and group-chat modes allow edge deletion', () => {
expect(isEdgeDeletionAllowed('handoff')).toBe(true);
expect(isEdgeDeletionAllowed('group-chat')).toBe(true);
expect(isEdgeDeletionAllowed('sequential')).toBe(false);
expect(isEdgeDeletionAllowed('concurrent')).toBe(false);
expect(isEdgeDeletionAllowed('group-chat')).toBe(false);
expect(isEdgeDeletionAllowed('single')).toBe(false);
});
@@ -248,6 +248,20 @@ describe('edge deletion rules', () => {
expect(nonDeletableEdges.length).toBeGreaterThan(0);
});
test('group-chat marks orchestrator↔agent edges as deletable', () => {
const pattern = findPattern('group-chat');
const graph = resolvePatternGraph(pattern);
const edges = toCanvasEdges(graph, 'group-chat');
const deletableEdges = edges.filter((e) => e.deletable);
const nonDeletableEdges = edges.filter((e) => !e.deletable);
// Orchestrator↔agent edges should be deletable
expect(deletableEdges.length).toBeGreaterThan(0);
// Structural edges (user-input → orchestrator, orchestrator → user-output)
expect(nonDeletableEdges.length).toBeGreaterThan(0);
});
test('user-input nodes use userInputNode type and user-output use userOutputNode type', () => {
const pattern = findPattern('sequential');
const graph = resolvePatternGraph(pattern);