diff --git a/src/renderer/src/components/automations/AutomationsListPanel.test.tsx b/src/renderer/src/components/automations/AutomationsListPanel.test.tsx index ab0be05df3b..3ccaefabfab 100644 --- a/src/renderer/src/components/automations/AutomationsListPanel.test.tsx +++ b/src/renderer/src/components/automations/AutomationsListPanel.test.tsx @@ -98,6 +98,7 @@ function renderPanel( requestExternalAction={() => undefined} openEditExternalDialog={() => undefined} openCreateDialog={() => undefined} + canCreateAutomation onOpenDetail={() => undefined} onRefresh={() => undefined} isRefreshing={false} diff --git a/src/renderer/src/components/automations/AutomationsPage.tsx b/src/renderer/src/components/automations/AutomationsPage.tsx index 7e3beff585a..85b4ddf5929 100644 --- a/src/renderer/src/components/automations/AutomationsPage.tsx +++ b/src/renderer/src/components/automations/AutomationsPage.tsx @@ -63,10 +63,7 @@ import type { AutomationTemplate } from './automation-templates' import { getAutomationTargetAvailability } from './automation-target-availability' import { getAutomationCreateAvailability } from './automation-create-admission' import { buildAutomationRunContextForRepo } from './automation-run-context' -import { - repoMatchesExternalAutomationTarget, - getExternalAutomationTargetForRepo -} from './automation-external-target-match' +import { repoMatchesExternalAutomationTarget } from './automation-external-target-match' import { ensureHooksConfirmed } from '@/lib/ensure-hooks-confirmed' import { getSettingsForRepoRuntimeOwner } from '@/lib/repo-runtime-owner' import { checkRuntimeHooks } from '@/runtime/runtime-hooks-client' @@ -82,6 +79,7 @@ import { getAutomationHostTargetFromKey, getAutomationHostTargetKey, getAutomationListTarget, + getAutomationOwnerTarget, getAutomationTargetFromHostId, listAutomationsForTarget, runAutomationNowForTarget, @@ -1349,27 +1347,7 @@ export default function AutomationsPage(): React.JSX.Element { : null const projectId = targetWorktree?.repoId ?? fallbackRepo?.id ?? '' const workspaceId = targetWorktree?.id ?? fallbackWorktree?.id ?? '' - const nextDraft: AutomationDraft = { - name: job.name, - prompt: job.prompt ?? job.promptPreview, - agentId: 'hermes', - projectId, - workspaceMode: 'existing', - workspaceId, - baseBranch: '', - setupDecision: undefined, - reuseSession: false, - precheckCommand: '', - precheckTimeoutSeconds: '60', - preset: hasCustomSchedule ? 'custom' : 'weekdays', - time: AUTOMATION_DEFAULT_TIME, - dayOfWeek: '1', - customSchedule: hasCustomSchedule ? rawSchedule : '', - missedRunGraceMinutes: '720', - scheduleWarning: hasCustomSchedule - ? null - : 'This Hermes automation has an unsupported saved schedule. Pick a supported schedule before saving changes.' - } + const nextDraft = buildExternalAutomationEditDraft(job, { projectId, workspaceId }) setEditingAutomationId(null) setEditingRowKey(null) setEditingDestination(null) diff --git a/src/renderer/src/components/automations/automation-host-client.ts b/src/renderer/src/components/automations/automation-host-client.ts index 79ef3c65436..52c2d85e341 100644 --- a/src/renderer/src/components/automations/automation-host-client.ts +++ b/src/renderer/src/components/automations/automation-host-client.ts @@ -127,9 +127,6 @@ export async function listAutomationRunsForTarget( export async function createAutomationForTarget(input: AutomationCreateInput): Promise { const target = getAutomationCreateTarget(input) - if (target.kind === 'local') { - return await window.api.automations.create(input) - } const result = await callRuntimeRpc<{ automation: Automation }>( target, 'automation.create',