diff --git a/CHANGELOG.md b/CHANGELOG.md index 43e286184..604849f01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ release's per-component sections are labelled beneath its heading. - An image or voice attachment that arrives as a link is now checked against what the link serves, the same as an uploaded one. A link whose content is not the declared type, or that cannot be read, is refused. +### archie-ui + +- A workflow created on the canvas now saves the agent it runs as, so it runs instead of parking with "declares no identity to run as". + ### archie-state-store - A workflow that no longer validates after an upgrade (for example it names a step type that was removed) is repaired at startup instead of breaking every workflow. A shipped workflow is restored from this release's copy; a workflow you created is removed and logged, and its earlier revision stays in the resource history. Valid workflows you created or edited are kept. diff --git a/ui/src/workflows/WorkflowEditor.vue b/ui/src/workflows/WorkflowEditor.vue index 5cdd5ef6f..278fbf8bc 100644 --- a/ui/src/workflows/WorkflowEditor.vue +++ b/ui/src/workflows/WorkflowEditor.vue @@ -35,7 +35,7 @@ import WorkflowCanvas from "./WorkflowCanvas.vue"; import WorkflowHistory from "./WorkflowHistory.vue"; import { useWorkflowHistory } from "./workflow-history"; import { revisionOfRun, type WorkflowRevision } from "./workflow-revisions"; -import { deleteStep, duplicateStep, insertStep, moveStep, normalizeStepIDs, replaceStep, revertWorkflowChange, stepAt, workflowChanges, workflowField, type StepPath } from "./workflow-edit"; +import { deleteStep, duplicateStep, insertStep, moveStep, normalizeStepIDs, replaceStep, revertWorkflowChange, SEEDED_AGENT_ID, stepAt, workflowChanges, workflowField, type StepPath } from "./workflow-edit"; import ChangeList from "@/components/ChangeList.vue"; import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog"; import { useWorkflowRuns } from "./workflow-runs"; @@ -168,7 +168,7 @@ function load(value: string): void { (candidate) => candidate.id === value, ); id.value = entry?.id ?? value; - loadedYaml.value = workflows.drafts.find((draft) => draft.id === value)?.yaml ?? entry?.yaml ?? `id: ${value}\nsteps: []\n`; + loadedYaml.value = workflows.drafts.find((draft) => draft.id === value)?.yaml ?? entry?.yaml ?? `id: ${value}\nidentity: ${SEEDED_AGENT_ID}\nsteps: []\n`; yaml.value = normalizeStepIDs(loadedYaml.value); open.value = null; localError.value = ""; diff --git a/ui/src/workflows/WorkflowSettings.vue b/ui/src/workflows/WorkflowSettings.vue index bc6570990..03b5cd5c1 100644 --- a/ui/src/workflows/WorkflowSettings.vue +++ b/ui/src/workflows/WorkflowSettings.vue @@ -14,7 +14,7 @@ import { useOrgStore } from "@/stores/org"; import { useSettingsStore } from "@/stores/settings"; import OptionSelect from "./OptionSelect.vue"; import SpecList from "./SpecList.vue"; -import { setWorkflowField, workflowField } from "./workflow-edit"; +import { SEEDED_AGENT_ID, setWorkflowField, workflowField } from "./workflow-edit"; const props = defineProps<{ yaml: string }>(); const emit = defineEmits<{ "update:yaml": [string] }>(); @@ -27,10 +27,8 @@ function set(key: string, value: unknown): void { emit("update:yaml", setWorkflowField(props.yaml, key, value)); } -// The identity a run acts as must be an agent, never a person; a workflow -// naming none is refused when it runs, so it defaults to the agent identity -// every install seeds (identity.AgentID). -const SEEDED_AGENT_ID = "6f129e29-0e26-5246-99bd-74cb4496203b"; +// The identity a run acts as must be an agent, never a person. +const seededAgentId: string = SEEDED_AGENT_ID; const identities = useOrgStore(); const agents = ref([]); const identitiesLoading = ref(true); @@ -85,7 +83,7 @@ const needs = computed<{ captures?: boolean; gate_retries?: number }>(() => { Runs as