+ Set the default alias: agent steps and chat that name no alias cannot run without it.
+
+
-
-
-
+
+
+
setRole(role, String(v))"
+ :aria-invalid="aliasIssue(alias) ? true : undefined"
+ @update:model-value="(v) => setAlias(alias, String(v))"
/>
-
- {{ roleIssue(role)?.message }}
- Provider not configured.
+
+ {{ aliasIssue(alias)?.message }}
+ Provider not configured.
-
-
diff --git a/ui/src/settings/model-choices.ts b/ui/src/settings/model-choices.ts
index 707c95ca4..3375c7b9b 100644
--- a/ui/src/settings/model-choices.ts
+++ b/ui/src/settings/model-choices.ts
@@ -1,8 +1,8 @@
import type { CatalogProvider } from "./types.ts";
-/** roleModelOptions lists "provider/model" for every model of a configured
- * provider: a role can only run on a provider Archie is set up to call. */
-export function roleModelOptions(catalog: CatalogProvider[], configured: string[]): string[] {
+/** aliasModelOptions lists "provider/model" for every model of a configured
+ * provider: an alias can only point at a provider Archie is set up to call. */
+export function aliasModelOptions(catalog: CatalogProvider[], configured: string[]): string[] {
return catalog
.filter((p) => configured.includes(p.id))
.flatMap((p) => p.models.map((m) => `${p.id}/${m}`));
diff --git a/ui/src/settings/validation.ts b/ui/src/settings/validation.ts
index 603f54466..0f30479c4 100644
--- a/ui/src/settings/validation.ts
+++ b/ui/src/settings/validation.ts
@@ -102,25 +102,29 @@ export function validateSchedules(value: unknown): FieldIssue[] {
return issues;
}
-/** validateModelRoles mirrors validateModelRoles exactly: the server's whole
- * predicate is `strings.TrimSpace(role) == "" || !strings.Contains(model,
- * "/")`. It deliberately does not impose a stricter shape, such as requiring
- * a non-space provider before the slash -- the dashboard refusing a value the
- * server would accept blocks a legitimate save. */
-export function validateModelRoles(value: unknown): FieldIssue[] {
- const roles = (value ?? {}) as Record
;
- return Object.entries(roles)
- .filter(([role, model]) => !role.trim() || !String(model).includes("/"))
- .map(([role]) => ({
- path: role,
- label: role.trim() || "Role",
- message: role.trim() ? "Use provider/model." : "Role name is required.",
- }));
+const MODEL_ALIAS_NAME = /^[a-z0-9][a-z0-9._-]*$/;
+
+/** validateModelAliases mirrors the server's validateModelAliases: alias
+ * names are lowercase tokens, each value splits on its first slash into a
+ * non-empty provider and model, and a non-empty table has a default alias. */
+export function validateModelAliases(value: unknown): FieldIssue[] {
+ const aliases = (value ?? {}) as Record;
+ const issues: FieldIssue[] = Object.entries(aliases).flatMap(([alias, model]): FieldIssue[] => {
+ if (!MODEL_ALIAS_NAME.test(alias))
+ return [{ path: alias, label: alias || "Alias", message: "Use lowercase letters, digits, '.', '_' or '-'." }];
+ const slash = String(model).indexOf("/");
+ if (slash <= 0 || slash === String(model).length - 1)
+ return [{ path: alias, label: alias, message: "Use provider/model." }];
+ return [];
+ });
+ if (Object.keys(aliases).length > 0 && !("default" in aliases))
+ issues.push({ path: "default", label: "default", message: "The default alias is required." });
+ return issues;
}
/** The rules the store applies to a dirty draft, keyed by resource kind. */
export const draftValidators: Record = {
"scheduling-policy": validateSchedulingPolicy,
schedules: validateSchedules,
- "model-role-assignments": validateModelRoles,
+ "model-aliases": validateModelAliases,
};
diff --git a/ui/src/stores/control-plane.ts b/ui/src/stores/control-plane.ts
index 8d743cce8..8d57ab753 100644
--- a/ui/src/stores/control-plane.ts
+++ b/ui/src/stores/control-plane.ts
@@ -200,7 +200,7 @@ const PAGE_RESOURCES: Record = {
credentials: ["credential-bindings"],
playbooks: ["eda-playbooks"],
tasks: ["workflow-execution-settings","task-policy"],
- models: ["provider-settings", "model-role-assignments"],
+ models: ["provider-settings", "model-aliases"],
repositories: ["repository-policies"],
channels: ["channel-settings"],
scheduling: ["scheduling-policy"],
diff --git a/ui/src/workflows/StepEditor.vue b/ui/src/workflows/StepEditor.vue
index a18175836..5d62dc778 100644
--- a/ui/src/workflows/StepEditor.vue
+++ b/ui/src/workflows/StepEditor.vue
@@ -17,7 +17,7 @@ import WorkflowPicker from "./WorkflowPicker.vue";
import { stepTitle } from "./workflow-graph";
import { settingsProblem, type SettingsSchema, type StepTypeInfo } from "./workflow-yaml";
-const props = defineProps<{ yaml: string; path: StepPath; vocabulary: StepTypeInfo[]; workflows: WorkflowDefinitionEntry[] }>();
+const props = defineProps<{ yaml: string; path: StepPath; vocabulary: StepTypeInfo[]; workflows: WorkflowDefinitionEntry[]; modelAliases: string[] }>();
const emit = defineEmits<{ "update:yaml": [string]; close: []; remove: [] }>();
const step = computed(() => stepAt(props.yaml, props.path) ?? {});
@@ -55,6 +55,7 @@ const longText = /mission|body|detail|plan|rules/;
function kindOf(key: string, schema: SettingsSchema): Kind {
if ((["workflow.call", "workflow.handoff"].includes(type.value) && key === "workflow") || (type.value === "human.approve" && key === "then")) return "workflow";
+ if (type.value === "agent.run" && key === "model") return "select";
if (schema.type === "string") return schema.enum ? "select" : longText.test(key) ? "text" : "line";
if (schema.type === "boolean") return "boolean";
if (schema.type === "integer" || schema.type === "number") return "number";
@@ -67,7 +68,7 @@ function kindOf(key: string, schema: SettingsSchema): Kind {
const fields = computed(() => {
const entries = Object.entries(info.value?.settings?.properties ?? {})
.filter(([key]) => type.value !== "workflow.call" || !["inputs", "outputs"].includes(key))
- .map(([key, schema]) => ({ key, schema, kind: kindOf(key, schema) }));
+ .map(([key, schema]) => ({ key, schema, kind: kindOf(key, schema), options: type.value === "agent.run" && key === "model" ? props.modelAliases : (schema.enum ?? []) }));
const lead = entries.filter((field) => LEAD.includes(field.key) && field.kind !== "boolean").sort((a, b) => LEAD.indexOf(a.key) - LEAD.indexOf(b.key))[0];
const rest = entries.filter((field) => field !== lead);
return {
@@ -198,7 +199,7 @@ const text = (key: string) => (typeof settings.value[key] === "string" ? (settin
@change="setSetting(fields.lead.key, ($event.target as HTMLSelectElement).value || undefined)"
>
-
+