feat(webui): Task execution, Models and Repositories on setting rows
Task execution: the two time limits as durations over their seconds fields, steppers for tool steps and gate failures. Models: roles checked as provider/model and warned when the provider is missing, providers as cards with class, base URL and key. Repositories: one card per repository with gate and preflight commands edited as argv tags (duplicates and commas kept), protected paths, retries and the review, storage and concurrency switches. Secret references no longer claim a credential resolved or went missing: the documents only say a reference is filled in, and an omitted boolean prop was being read as not found.
This commit is contained in:
1 parent
b1a5954594
commit
081e5bbfd9
11 files changed
+425
-73
No files matched your search
@@ -165,7 +165,6 @@ const replyModes = [
|
||||
<SecretRefField
|
||||
v-model="chat.telegram.token_ref"
|
||||
id-prefix="tg-token"
|
||||
:resolved="chat.telegram.token_ref.key ? chat.telegram.credential_configured : undefined"
|
||||
/>
|
||||
</SettingRow>
|
||||
<SettingRow label="Allowed users" hint="Telegram user IDs. Everyone else is ignored.">
|
||||
@@ -209,7 +208,6 @@ const replyModes = [
|
||||
<SecretRefField
|
||||
v-model="chat.webhook.secret_ref"
|
||||
id-prefix="wh-secret"
|
||||
:resolved="chat.webhook.secret_ref.key ? chat.webhook.credential_configured : undefined"
|
||||
/>
|
||||
</SettingRow>
|
||||
</template>
|
||||
|
||||
@@ -2,13 +2,18 @@
|
||||
import { CircleCheck, CircleAlert, Lock } from "@lucide/vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
||||
defineProps<{
|
||||
engine: string;
|
||||
secretKey: string;
|
||||
/** undefined while unknown; the resolved line is hidden. */
|
||||
resolved?: boolean;
|
||||
disabled?: boolean;
|
||||
}>();
|
||||
// resolved defaults to undefined, not false: Vue casts an omitted boolean prop
|
||||
// to false, which would claim "not found" for a reference nothing checked.
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
engine: string;
|
||||
secretKey: string;
|
||||
/** undefined while unknown; the status line is hidden. */
|
||||
resolved?: boolean;
|
||||
disabled?: boolean;
|
||||
}>(),
|
||||
{ resolved: undefined },
|
||||
);
|
||||
defineEmits<{ change: [] }>();
|
||||
</script>
|
||||
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
<script setup lang="ts">
|
||||
import { Plus, Trash2 } from "@lucide/vue";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
TagsInput,
|
||||
TagsInputInput,
|
||||
TagsInputItem,
|
||||
TagsInputItemDelete,
|
||||
TagsInputItemText,
|
||||
} from "@/components/ui/tags-input";
|
||||
|
||||
/** A list of commands, each an argv array: one tag per argument, so nothing
|
||||
* is ever re-split by a shell. */
|
||||
const props = defineProps<{ label: string; emptyText?: string }>();
|
||||
const commands = defineModel<string[][] | null>({ required: true });
|
||||
|
||||
function add() {
|
||||
commands.value = [...(commands.value ?? []), []];
|
||||
}
|
||||
function remove(i: number) {
|
||||
const next = [...(commands.value ?? [])];
|
||||
next.splice(i, 1);
|
||||
commands.value = next;
|
||||
}
|
||||
function set(i: number, argv: string[]) {
|
||||
const next = [...(commands.value ?? [])];
|
||||
next[i] = argv;
|
||||
commands.value = next;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="grid gap-2">
|
||||
<p v-if="!commands?.length && props.emptyText" class="text-xs text-fg-subtle">{{ props.emptyText }}</p>
|
||||
<div v-for="(argv, i) in commands ?? []" :key="i" class="flex items-start gap-2">
|
||||
<span class="w-5 pt-2 text-right font-mono text-xs text-fg-subtle">{{ i + 1 }}</span>
|
||||
<TagsInput
|
||||
:model-value="argv"
|
||||
duplicate
|
||||
:delimiter="'\u0000'"
|
||||
class="flex-1 font-mono"
|
||||
:aria-label="`${props.label} command ${i + 1}`"
|
||||
@update:model-value="(v) => set(i, v as string[])"
|
||||
>
|
||||
<TagsInputItem v-for="(arg, j) in argv" :key="`${j}-${arg}`" :value="arg">
|
||||
<TagsInputItemText />
|
||||
<TagsInputItemDelete />
|
||||
</TagsInputItem>
|
||||
<TagsInputInput placeholder="argument" />
|
||||
</TagsInput>
|
||||
<Button variant="ghost" size="icon" :aria-label="`Remove ${props.label} command ${i + 1}`" @click="remove(i)"><Trash2 /></Button>
|
||||
</div>
|
||||
<div>
|
||||
<Button variant="outline" size="sm" @click="add"><Plus data-icon="inline-start" /> Add command</Button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -11,7 +11,11 @@ interface SecretRef {
|
||||
key: string;
|
||||
}
|
||||
|
||||
defineProps<{ resolved?: boolean; disabled?: boolean; idPrefix: string }>();
|
||||
// resolved stays unset until something actually resolves the reference: a
|
||||
// filled-in engine and key says nothing about whether the secret exists.
|
||||
withDefaults(defineProps<{ resolved?: boolean; disabled?: boolean; idPrefix: string }>(), {
|
||||
resolved: undefined,
|
||||
});
|
||||
const model = defineModel<SecretRef>({ required: true });
|
||||
const editing = ref(false);
|
||||
</script>
|
||||
|
||||
@@ -1,34 +1,135 @@
|
||||
<script setup lang="ts">
|
||||
import HistoryLink from "@/settings/HistoryLink.vue";
|
||||
import { computed, onMounted } from "vue";
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { Plus, Trash2 } from "@lucide/vue";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { SettingRow } from "@/components/ui/setting-row";
|
||||
import { StatusPill } from "@/components/ui/status-pill";
|
||||
import { resourcesForPage, useControlPlaneStore } from "@/stores/control-plane";
|
||||
import StructuredResourceCard from "./StructuredResourceCard.vue";
|
||||
import HistoryLink from "./HistoryLink.vue";
|
||||
import SecretRefField from "./SecretRefField.vue";
|
||||
|
||||
interface Provider {
|
||||
class: string;
|
||||
api_key_env?: string;
|
||||
api_key_ref: { engine: string; key: string };
|
||||
base_url?: string;
|
||||
has_credential?: boolean;
|
||||
}
|
||||
|
||||
const store = useControlPlaneStore();
|
||||
const { catalog, catalogError } = storeToRefs(store);
|
||||
onMounted(store.load);
|
||||
|
||||
const controlPlane = useControlPlaneStore();
|
||||
const { catalog, catalogError } = storeToRefs(controlPlane);
|
||||
const resources = computed(() => resourcesForPage(catalog.value, "models"));
|
||||
onMounted(controlPlane.load);
|
||||
const providers = computed(() => store.drafts["provider-settings"]?.value as Record<string, Provider> | undefined);
|
||||
const roles = computed(() => store.drafts["model-role-assignments"]?.value as Record<string, string> | undefined);
|
||||
const errors = computed(() =>
|
||||
["provider-settings", "model-role-assignments"].map((k) => store.stateFor(k).error).filter(Boolean),
|
||||
);
|
||||
|
||||
// A role references "provider/model", and the server refuses anything else.
|
||||
const roleValid = (model: string) => /^[^/\s]+\/\S+$/.test(model);
|
||||
const providerKnown = (model: string) => !!providers.value?.[model.split("/")[0]!];
|
||||
|
||||
// Providers are keyed by name, so a rename moves the entry.
|
||||
function renameProvider(from: string, to: string) {
|
||||
const p = providers.value;
|
||||
if (!p || !to || to === from || p[to]) return;
|
||||
p[to] = p[from]!;
|
||||
delete p[from];
|
||||
}
|
||||
const newProvider = ref("");
|
||||
function addProvider() {
|
||||
const name = newProvider.value.trim();
|
||||
if (!providers.value || !name || providers.value[name]) return;
|
||||
providers.value[name] = { class: name, api_key_ref: { engine: "", key: "" } };
|
||||
newProvider.value = "";
|
||||
}
|
||||
const newRole = ref("");
|
||||
function addRole() {
|
||||
const name = newRole.value.trim();
|
||||
if (!roles.value || !name || name in roles.value) return;
|
||||
roles.value[name] = "";
|
||||
newRole.value = "";
|
||||
}
|
||||
const eyebrow = "mb-1 text-[11px] font-medium tracking-[0.06em] text-fg-subtle uppercase";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Models">
|
||||
<HistoryLink :kinds="resources.map((r) => r.kind)" />
|
||||
<StatusPill tone="warn">Applies after restart</StatusPill>
|
||||
</PageHeader>
|
||||
<p class="-mt-4 mb-8 text-sm text-fg-muted">Which model plays each role, and the providers that serve them.</p>
|
||||
|
||||
<p v-if="catalogError" class="text-sm text-destructive" role="alert">
|
||||
{{ catalogError }}
|
||||
<p v-for="e in [catalogError, ...errors].filter(Boolean)" :key="String(e)" class="mb-4 text-sm text-danger" role="alert">
|
||||
{{ e }}
|
||||
</p>
|
||||
<StructuredResourceCard
|
||||
v-for="descriptor in resources"
|
||||
:key="descriptor.kind"
|
||||
:descriptor="descriptor"
|
||||
:root-path="
|
||||
descriptor.kind === 'provider-settings' ? 'providers' : 'roles'
|
||||
"
|
||||
/>
|
||||
|
||||
<template v-if="roles">
|
||||
<h2 :class="eyebrow">Roles</h2>
|
||||
<SettingRow v-for="(_, role) in roles" :key="role" :label="String(role)" :for="`role-${role}`">
|
||||
<div class="flex items-center gap-2">
|
||||
<Input
|
||||
:id="`role-${role}`"
|
||||
v-model="roles[role]"
|
||||
class="max-w-md font-mono"
|
||||
placeholder="provider/model"
|
||||
:aria-invalid="!roleValid(roles[role] ?? '') || undefined"
|
||||
/>
|
||||
<Button variant="ghost" size="icon" :aria-label="`Remove role ${role}`" @click="delete roles[role]"><Trash2 /></Button>
|
||||
</div>
|
||||
<p v-if="!roleValid(roles[role] ?? '')" class="mt-1.5 text-xs text-danger">Write it as provider/model.</p>
|
||||
<p v-else-if="providers && !providerKnown(roles[role] ?? '')" class="mt-1.5 text-xs text-warn">
|
||||
No provider named {{ (roles[role] ?? "").split("/")[0] }} below.
|
||||
</p>
|
||||
</SettingRow>
|
||||
<div class="flex gap-2 border-t border-border py-4">
|
||||
<Input v-model="newRole" class="max-w-56 font-mono" placeholder="role name" aria-label="New role" @keydown.enter="addRole" />
|
||||
<Button variant="outline" size="sm" :disabled="!newRole.trim()" @click="addRole"><Plus data-icon="inline-start" /> Add role</Button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-if="providers">
|
||||
<h2 :class="[eyebrow, 'mt-10']">Providers</h2>
|
||||
<section
|
||||
v-for="(provider, name) in providers"
|
||||
:key="name"
|
||||
class="mb-4 rounded-lg border border-border bg-card px-5 pt-4 pb-2"
|
||||
:aria-label="String(name)"
|
||||
>
|
||||
<header class="flex items-center gap-2">
|
||||
<Input
|
||||
:model-value="String(name)"
|
||||
class="max-w-56 font-mono font-medium"
|
||||
:aria-label="`Provider name ${name}`"
|
||||
@change="(e: Event) => renameProvider(String(name), (e.target as HTMLInputElement).value.trim())"
|
||||
/>
|
||||
<Button variant="ghost" size="icon" class="ml-auto" :aria-label="`Remove provider ${name}`" @click="delete providers[name]"><Trash2 /></Button>
|
||||
</header>
|
||||
<SettingRow label="Class" :for="`prov-${name}-class`" hint="The provider API it speaks (openai, anthropic, gemini, ollama, ...).">
|
||||
<Input :id="`prov-${name}-class`" v-model="provider.class" class="max-w-56 font-mono" />
|
||||
</SettingRow>
|
||||
<SettingRow label="Base URL" :for="`prov-${name}-url`" hint="Empty uses the provider's own endpoint.">
|
||||
<Input :id="`prov-${name}-url`" v-model="provider.base_url" class="max-w-md font-mono" />
|
||||
</SettingRow>
|
||||
<SettingRow label="API key" hint="Where Archie reads the key from.">
|
||||
<p v-if="provider.api_key_env && !provider.api_key_ref.key" class="mb-2 text-xs text-fg-muted">
|
||||
Passed to agents as <span class="font-mono text-foreground">{{ provider.api_key_env }}</span>; no secret
|
||||
reference is stored for it.
|
||||
</p>
|
||||
<SecretRefField v-model="provider.api_key_ref" :id-prefix="`prov-${name}-key`" />
|
||||
</SettingRow>
|
||||
</section>
|
||||
<div class="flex gap-2">
|
||||
<Input v-model="newProvider" class="max-w-56 font-mono" placeholder="provider name" aria-label="New provider" @keydown.enter="addProvider" />
|
||||
<Button variant="outline" size="sm" :disabled="!newProvider.trim()" @click="addProvider"><Plus data-icon="inline-start" /> Add provider</Button>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,34 +1,163 @@
|
||||
<script setup lang="ts">
|
||||
import HistoryLink from "@/settings/HistoryLink.vue";
|
||||
import { computed, onMounted } from "vue";
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { Plus, Trash2 } from "@lucide/vue";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import {
|
||||
NumberField,
|
||||
NumberFieldContent,
|
||||
NumberFieldDecrement,
|
||||
NumberFieldIncrement,
|
||||
NumberFieldInput,
|
||||
} from "@/components/ui/number-field";
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/components/ui/select";
|
||||
import { SettingRow } from "@/components/ui/setting-row";
|
||||
import { StatusPill } from "@/components/ui/status-pill";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import {
|
||||
TagsInput,
|
||||
TagsInputInput,
|
||||
TagsInputItem,
|
||||
TagsInputItemDelete,
|
||||
TagsInputItemText,
|
||||
} from "@/components/ui/tags-input";
|
||||
import { resourcesForPage, useControlPlaneStore } from "@/stores/control-plane";
|
||||
import StructuredResourceCard from "./StructuredResourceCard.vue";
|
||||
import CommandListEditor from "./CommandListEditor.vue";
|
||||
import HistoryLink from "./HistoryLink.vue";
|
||||
|
||||
const controlPlane = useControlPlaneStore();
|
||||
const { catalog, catalogError } = storeToRefs(controlPlane);
|
||||
const resources = computed(() =>
|
||||
resourcesForPage(catalog.value, "repositories"),
|
||||
);
|
||||
onMounted(controlPlane.load);
|
||||
const KIND = "repository-policies";
|
||||
|
||||
interface Repo {
|
||||
owner: string;
|
||||
name: string;
|
||||
base: string;
|
||||
ecosystem: string;
|
||||
gate: string[][] | null;
|
||||
preflight: string[][] | null;
|
||||
protect: string[] | null;
|
||||
test_glob: string;
|
||||
persistent_storage: boolean;
|
||||
max_retries: number;
|
||||
allow_concurrent: boolean;
|
||||
review_enabled: boolean;
|
||||
}
|
||||
|
||||
const store = useControlPlaneStore();
|
||||
const { catalog, catalogError } = storeToRefs(store);
|
||||
onMounted(store.load);
|
||||
|
||||
const resources = computed(() => resourcesForPage(catalog.value, "repositories"));
|
||||
const repos = computed(() => store.drafts[KIND]?.value as Repo[] | undefined);
|
||||
const error = computed(() => store.stateFor(KIND).error);
|
||||
|
||||
const ecosystems = ["go", "python", "node", "rust", "custom"];
|
||||
const newRepo = ref("");
|
||||
function addRepo() {
|
||||
const [owner, name] = newRepo.value.trim().split("/");
|
||||
if (!repos.value || !owner || !name) return;
|
||||
repos.value.push({
|
||||
owner, name, base: "main", ecosystem: "go", gate: [], preflight: null, protect: null,
|
||||
test_glob: "", persistent_storage: false, max_retries: 0, allow_concurrent: false, review_enabled: false,
|
||||
});
|
||||
newRepo.value = "";
|
||||
}
|
||||
const protectOf = (repo: Repo) => repo.protect ?? [];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Repositories">
|
||||
<HistoryLink :kinds="resources.map((r) => r.kind)" />
|
||||
<StatusPill tone="warn">Applies after restart</StatusPill>
|
||||
</PageHeader>
|
||||
<p class="-mt-4 mb-8 text-sm text-fg-muted">Repositories Archie works in, and the checks each one must pass.</p>
|
||||
|
||||
<p v-if="catalogError" class="text-sm text-destructive" role="alert">
|
||||
{{ catalogError }}
|
||||
</p>
|
||||
<StructuredResourceCard
|
||||
v-for="descriptor in resources"
|
||||
:key="descriptor.kind"
|
||||
:descriptor="descriptor"
|
||||
root-path="repositories"
|
||||
/>
|
||||
<p v-if="catalogError || error" class="mb-4 text-sm text-danger" role="alert">{{ catalogError || error }}</p>
|
||||
|
||||
<template v-if="repos">
|
||||
<section
|
||||
v-for="(repo, i) in repos"
|
||||
:key="i"
|
||||
class="mb-4 rounded-lg border border-border bg-card px-5 pt-4 pb-2"
|
||||
:aria-label="`${repo.owner}/${repo.name}`"
|
||||
>
|
||||
<header class="flex items-center gap-2">
|
||||
<h2 class="min-w-0 flex-1 truncate font-mono text-[15px] font-medium">{{ repo.owner }}/{{ repo.name }}</h2>
|
||||
<Button variant="ghost" size="icon" :aria-label="`Remove ${repo.owner}/${repo.name}`" @click="repos.splice(i, 1)"><Trash2 /></Button>
|
||||
</header>
|
||||
<SettingRow label="Base branch" :for="`repo-${i}-base`" hint="The branch pull requests target.">
|
||||
<Input :id="`repo-${i}-base`" v-model="repo.base" class="max-w-56 font-mono" />
|
||||
</SettingRow>
|
||||
<SettingRow label="Ecosystem" hint="Picks the default preflight check and test file pattern.">
|
||||
<Select v-model="repo.ecosystem">
|
||||
<SelectTrigger class="w-40 font-mono" :aria-label="`Ecosystem for ${repo.name}`"><SelectValue /></SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem v-for="e in ecosystems" :key="e" :value="e">{{ e }}</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</SettingRow>
|
||||
<SettingRow label="Quality gate" hint="Run in order after each change. The last command is the test runner.">
|
||||
<CommandListEditor v-model="repo.gate" label="Gate" empty-text="No gate: changes are not checked." />
|
||||
</SettingRow>
|
||||
<SettingRow label="Preflight" hint="Checks run before work starts. Empty uses the ecosystem's default.">
|
||||
<CommandListEditor v-model="repo.preflight" label="Preflight" empty-text="Using the ecosystem default." />
|
||||
</SettingRow>
|
||||
<SettingRow label="Test files" :for="`repo-${i}-glob`" hint="Pattern for test files. Empty uses the ecosystem's default.">
|
||||
<Input :id="`repo-${i}-glob`" v-model="repo.test_glob" class="max-w-56 font-mono" placeholder="*_test.go" />
|
||||
</SettingRow>
|
||||
<SettingRow label="Protected paths" hint="Path endings agents must never write, such as generated files.">
|
||||
<TagsInput
|
||||
:model-value="protectOf(repo)"
|
||||
class="font-mono"
|
||||
:aria-label="`Protected paths for ${repo.name}`"
|
||||
@update:model-value="(v) => (repo.protect = v as string[])"
|
||||
>
|
||||
<TagsInputItem v-for="p in protectOf(repo)" :key="p" :value="p">
|
||||
<TagsInputItemText />
|
||||
<TagsInputItemDelete />
|
||||
</TagsInputItem>
|
||||
<TagsInputInput placeholder="_templ.go" />
|
||||
</TagsInput>
|
||||
</SettingRow>
|
||||
<SettingRow label="Max retries" hint="Times a parked task is retried before it is marked dead. 0 uses the scheduling policy's value.">
|
||||
<NumberField v-model="repo.max_retries" :min="0" class="w-32">
|
||||
<NumberFieldContent>
|
||||
<NumberFieldDecrement />
|
||||
<NumberFieldInput class="font-mono" :aria-label="`Max retries for ${repo.name}`" />
|
||||
<NumberFieldIncrement />
|
||||
</NumberFieldContent>
|
||||
</NumberField>
|
||||
</SettingRow>
|
||||
<SettingRow label="Adversarial review" hint="A fresh reviewer checks each change after the gate passes and before the PR opens.">
|
||||
<Switch v-model="repo.review_enabled" :aria-label="`Adversarial review for ${repo.name}`" />
|
||||
</SettingRow>
|
||||
<SettingRow label="Persistent storage" hint="A Docker volume kept across tasks, for expensive build caches.">
|
||||
<Switch v-model="repo.persistent_storage" :aria-label="`Persistent storage for ${repo.name}`" />
|
||||
</SettingRow>
|
||||
<SettingRow
|
||||
label="Concurrent tasks"
|
||||
hint="On: several tasks run in this repository at once. Only safe when their worktrees cannot collide."
|
||||
:tone="repo.allow_concurrent ? 'danger' : 'default'"
|
||||
>
|
||||
<Switch v-model="repo.allow_concurrent" :aria-label="`Concurrent tasks for ${repo.name}`" />
|
||||
</SettingRow>
|
||||
</section>
|
||||
|
||||
<div class="flex gap-2">
|
||||
<Input v-model="newRepo" class="max-w-72 font-mono" placeholder="owner/repository" aria-label="New repository" @keydown.enter="addRepo" />
|
||||
<Button variant="outline" size="sm" :disabled="!/^[^/\s]+\/[^/\s]+$/.test(newRepo.trim())" @click="addRepo">
|
||||
<Plus data-icon="inline-start" /> Add repository
|
||||
</Button>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,17 +1,49 @@
|
||||
<script setup lang="ts">
|
||||
import HistoryLink from "@/settings/HistoryLink.vue";
|
||||
import { computed, onMounted } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { useControlPlaneStore } from "@/stores/control-plane";
|
||||
import { resourcesForPage } from "@/stores/control-plane";
|
||||
import StructuredResourceCard from "./StructuredResourceCard.vue";
|
||||
import { DurationInput, formatGoDuration, parseGoDuration } from "@/components/ui/duration-input";
|
||||
import {
|
||||
NumberField,
|
||||
NumberFieldContent,
|
||||
NumberFieldDecrement,
|
||||
NumberFieldIncrement,
|
||||
NumberFieldInput,
|
||||
} from "@/components/ui/number-field";
|
||||
import { SettingRow } from "@/components/ui/setting-row";
|
||||
import { resourcesForPage, useControlPlaneStore } from "@/stores/control-plane";
|
||||
import HistoryLink from "./HistoryLink.vue";
|
||||
|
||||
const KIND = "workflow-execution-settings";
|
||||
|
||||
interface ExecutionSettings {
|
||||
max_model_tool_steps: number;
|
||||
max_runtime_seconds: number;
|
||||
max_consecutive_gate_failures: number;
|
||||
max_task_runtime_seconds: number | null;
|
||||
}
|
||||
|
||||
const store = useControlPlaneStore();
|
||||
const { catalog, catalogError } = storeToRefs(store);
|
||||
onMounted(store.load);
|
||||
|
||||
const controlPlane = useControlPlaneStore();
|
||||
const { catalog, catalogError } = storeToRefs(controlPlane);
|
||||
const resources = computed(() => resourcesForPage(catalog.value, "tasks"));
|
||||
onMounted(controlPlane.load);
|
||||
const limits = computed(() => store.drafts[KIND]?.value as ExecutionSettings | undefined);
|
||||
const error = computed(() => store.stateFor(KIND).error);
|
||||
|
||||
// The document counts seconds; the input speaks durations.
|
||||
function seconds(key: "max_runtime_seconds" | "max_task_runtime_seconds") {
|
||||
return computed({
|
||||
get: () => formatGoDuration((limits.value?.[key] ?? 0) * 1000),
|
||||
set: (text: string) => {
|
||||
const ms = parseGoDuration(text);
|
||||
if (limits.value && ms !== null) limits.value[key] = Math.round(ms / 1000);
|
||||
},
|
||||
});
|
||||
}
|
||||
const callRuntime = seconds("max_runtime_seconds");
|
||||
const taskRuntime = seconds("max_task_runtime_seconds");
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -19,14 +51,37 @@ onMounted(controlPlane.load);
|
||||
<PageHeader title="Task execution">
|
||||
<HistoryLink :kinds="resources.map((r) => r.kind)" />
|
||||
</PageHeader>
|
||||
<p class="-mt-4 mb-8 text-sm text-fg-muted">Limits every task runs under. Zero turns a limit off.</p>
|
||||
|
||||
<p v-if="catalogError" class="text-sm text-destructive" role="alert">
|
||||
{{ catalogError }}
|
||||
<p v-if="catalogError || error" class="mb-4 text-sm text-danger" role="alert">
|
||||
{{ catalogError || error }}
|
||||
</p>
|
||||
<StructuredResourceCard
|
||||
v-for="descriptor in resources"
|
||||
:key="descriptor.kind"
|
||||
:descriptor="descriptor"
|
||||
/>
|
||||
|
||||
<template v-if="limits">
|
||||
<SettingRow label="Task time limit" for="te-task" hint="A task still running after this long is parked.">
|
||||
<DurationInput id="te-task" v-model="taskRuntime" :units="['m', 'h']" />
|
||||
</SettingRow>
|
||||
<SettingRow label="Agent call time limit" for="te-call" hint="The longest one agent call inside a stage may run.">
|
||||
<DurationInput id="te-call" v-model="callRuntime" :units="['s', 'm', 'h']" />
|
||||
</SettingRow>
|
||||
<SettingRow label="Model tool steps" hint="Model and tool round-trips one agent call may take.">
|
||||
<NumberField v-model="limits.max_model_tool_steps" :min="0" class="w-32">
|
||||
<NumberFieldContent>
|
||||
<NumberFieldDecrement />
|
||||
<NumberFieldInput class="font-mono" aria-label="Model tool steps" />
|
||||
<NumberFieldIncrement />
|
||||
</NumberFieldContent>
|
||||
</NumberField>
|
||||
</SettingRow>
|
||||
<SettingRow label="Gate failures in a row" hint="Consecutive failed quality gates before the task is parked.">
|
||||
<NumberField v-model="limits.max_consecutive_gate_failures" :min="0" class="w-32">
|
||||
<NumberFieldContent>
|
||||
<NumberFieldDecrement />
|
||||
<NumberFieldInput class="font-mono" aria-label="Gate failures in a row" />
|
||||
<NumberFieldIncrement />
|
||||
</NumberFieldContent>
|
||||
</NumberField>
|
||||
</SettingRow>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
@@ -106,7 +106,6 @@ const eyebrow = "mb-1 text-[11px] font-medium tracking-[0.06em] text-fg-subtle u
|
||||
<SecretRefField
|
||||
v-model="tools.minimax.api_key_ref"
|
||||
id-prefix="minimax-key"
|
||||
:resolved="tools.minimax.credential_configured"
|
||||
:disabled="!tools.minimax.enabled"
|
||||
/>
|
||||
</SettingRow>
|
||||
|
||||
Reference in new issue
Block a user