From 81eb8f7c82560e88395e52e228c3d13a88494c8e Mon Sep 17 00:00:00 2001 From: David Kaya Date: Sun, 5 Apr 2026 21:59:16 +0200 Subject: [PATCH] refactor(workflows): remove code-executor and align function node with Agent Framework Remove the invented code-executor node type entirely. Rename function-executor to invoke-function to match Agent Framework's InvokeFunctionTool declarative action. Update InvokeFunctionConfig to use functionName, arguments, requireApproval, and resultVariable properties matching the upstream schema. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/renderer/components/WorkflowEditor.tsx | 12 +- .../workflow/CodeExecutorInspector.tsx | 174 ------------------ ...pector.tsx => InvokeFunctionInspector.tsx} | 120 ++++++------ .../workflow/WorkflowGraphInspector.tsx | 27 +-- .../workflow/WorkflowGraphNodes.tsx | 24 +-- .../workflow/WorkflowNodePalette.tsx | 5 +- src/renderer/lib/workflowGraph.ts | 6 +- src/shared/domain/workflow.ts | 66 ++----- tests/shared/workflow.test.ts | 59 +++--- 9 files changed, 122 insertions(+), 371 deletions(-) delete mode 100644 src/renderer/components/workflow/CodeExecutorInspector.tsx rename src/renderer/components/workflow/{FunctionExecutorInspector.tsx => InvokeFunctionInspector.tsx} (67%) diff --git a/src/renderer/components/WorkflowEditor.tsx b/src/renderer/components/WorkflowEditor.tsx index 66835f5..70204bd 100644 --- a/src/renderer/components/WorkflowEditor.tsx +++ b/src/renderer/components/WorkflowEditor.tsx @@ -97,10 +97,8 @@ function defaultConfigForKind(kind: WorkflowNodeKind): WorkflowNodeConfig { model: 'gpt-5.4', reasoningEffort: 'high', }; - case 'code-executor': - return { kind: 'code-executor' }; - case 'function-executor': - return { kind: 'function-executor', functionRef: '' }; + case 'invoke-function': + return { kind: 'invoke-function', functionName: '', arguments: {} }; case 'sub-workflow': return { kind: 'sub-workflow' }; case 'request-port': @@ -116,10 +114,8 @@ function defaultLabelForKind(kind: WorkflowNodeKind): string { return 'End'; case 'agent': return 'New Agent'; - case 'code-executor': - return 'Code Executor'; - case 'function-executor': - return 'Function'; + case 'invoke-function': + return 'Function Tool'; case 'sub-workflow': return 'Sub-Workflow'; case 'request-port': diff --git a/src/renderer/components/workflow/CodeExecutorInspector.tsx b/src/renderer/components/workflow/CodeExecutorInspector.tsx deleted file mode 100644 index cce5065..0000000 --- a/src/renderer/components/workflow/CodeExecutorInspector.tsx +++ /dev/null @@ -1,174 +0,0 @@ -import { useCallback } from 'react'; -import { AlertCircle, Code, Trash2 } from 'lucide-react'; - -import type { - CodeExecutorConfig, - WorkflowNode, - WorkflowNodeConfig, - WorkflowValidationIssue, -} from '@shared/domain/workflow'; - -interface CodeExecutorInspectorProps { - node: WorkflowNode; - validationIssues?: WorkflowValidationIssue[]; - onNodeChange: (nodeId: string, patch: Partial) => void; - onNodeConfigChange: (nodeId: string, config: WorkflowNodeConfig) => void; - onNodeRemove: (nodeId: string) => void; -} - -function InputField({ - label, - value, - onChange, - multiline, - placeholder, -}: { - label: string; - value: string; - onChange: (value: string) => void; - multiline?: boolean; - placeholder?: string; -}) { - const base = - 'w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-1)] px-3 py-2 text-[13px] text-[var(--color-text-primary)] placeholder-[var(--color-text-muted)] outline-none transition focus:border-[var(--color-accent)]/50'; - return ( -