refactor: remove legacy patterns system, unify on workflows

Remove the entire patterns domain model, IPC channels, sidecar services,
renderer components, and tests. Sessions now bind exclusively to workflows
via workflowId. Builtin workflows replace builtin patterns.

Backend:
- Make AgentNodeConfig standalone (no longer extends PatternAgentDefinition)
- Add WorkflowOrchestrationMode and WorkflowExecutionDefinition
- Create builtin workflows (single-agent, sequential, concurrent, handoff, group-chat)
- Rewrite session model config helpers for workflow-only
- Remove pattern IPC channels, handlers, and preload bindings
- Merge createSession/createWorkflowSession into single method
- Remove sidecar PatternGraphResolver, PatternValidator, pattern DTOs
- Add workspace migration for legacy sessions (patternId -> workflowId)

Frontend:
- Delete PatternEditor, pattern-graph components, patternGraph lib
- Delete NewSessionModal (session creation uses workflows directly)
- Remove PatternsSection from SettingsPanel
- Update App.tsx, ChatPane, ActivityPanel, Sidebar, RunTimeline,
  AgentConfigFields, InlinePills, sessionActivity to use workflow types
- Delete pattern.ts domain module

78 files changed across backend and frontend.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-04-06 22:37:00 +02:00
co-authored by Copilot
parent 69d0804161
commit 805e369b67
78 changed files with 2303 additions and 4441 deletions
@@ -15,7 +15,6 @@ public sealed class WorkflowRunnerTests
WorkflowRunner runner = new();
Workflow workflow = runner.BuildWorkflow(
CreateSubworkflowParent(inlineWorkflow: CreateAgentWorkflow("child-inline", "agent-child")),
CreatePattern("agent-child"),
[CreateChatClientAgent("agent-child", "Child Agent")]);
ProtocolDescriptor descriptor = await workflow.DescribeProtocolAsync();
@@ -30,7 +29,6 @@ public sealed class WorkflowRunnerTests
WorkflowDefinitionDto childWorkflow = CreateAgentWorkflow("child-ref", "agent-child");
Workflow workflow = runner.BuildWorkflow(
CreateSubworkflowParent(workflowId: childWorkflow.Id),
CreatePattern("agent-child"),
[CreateChatClientAgent("agent-child", "Child Agent")],
[childWorkflow]);
@@ -46,7 +44,6 @@ public sealed class WorkflowRunnerTests
InvalidOperationException error = Assert.Throws<InvalidOperationException>(() => runner.BuildWorkflow(
CreateSubworkflowParent(workflowId: "missing-child"),
CreatePattern("agent-child"),
[CreateChatClientAgent("agent-child", "Child Agent")],
[]));
@@ -65,7 +62,6 @@ public sealed class WorkflowRunnerTests
Kind = "code-executor",
Implementation = "return-text:done",
}),
CreateEmptyPattern(),
[]);
List<ChatMessage> output = await RunWorkflowToOutputAsync(workflow);
@@ -81,7 +77,6 @@ public sealed class WorkflowRunnerTests
WorkflowRunner runner = new();
Workflow workflow = runner.BuildWorkflow(
CreateStatefulFunctionWorkflow(),
CreateEmptyPattern(),
[]);
List<ChatMessage> output = await RunWorkflowToOutputAsync(workflow);
@@ -105,7 +100,6 @@ public sealed class WorkflowRunnerTests
ResponseType = "string",
Prompt = "Approve the workflow?",
}),
CreateEmptyPattern(),
[]);
ChatMessage[] input =
@@ -153,33 +147,11 @@ public sealed class WorkflowRunnerTests
Kind = "function-executor",
FunctionRef = "missing-function",
}),
CreateEmptyPattern(),
[]));
Assert.Contains("unsupported functionRef", error.Message, StringComparison.OrdinalIgnoreCase);
}
private static PatternDefinitionDto CreatePattern(string agentId)
{
return new PatternDefinitionDto
{
Id = "pattern-1",
Name = "Workflow Pattern",
Mode = "single",
Availability = "available",
Agents =
[
new PatternAgentDefinitionDto
{
Id = agentId,
Name = "Child Agent",
Instructions = "Help with the request.",
Model = "gpt-5.4",
},
],
};
}
private static WorkflowDefinitionDto CreateAgentWorkflow(string id, string agentId)
{
return new WorkflowDefinitionDto
@@ -243,18 +215,6 @@ public sealed class WorkflowRunnerTests
};
}
private static PatternDefinitionDto CreateEmptyPattern()
{
return new PatternDefinitionDto
{
Id = "pattern-empty",
Name = "Workflow Pattern",
Mode = "single",
Availability = "available",
Agents = [],
};
}
private static WorkflowDefinitionDto CreateSubworkflowParent(
string? workflowId = null,
WorkflowDefinitionDto? inlineWorkflow = null)