diff --git a/ui/src/components/AgentConfigForm.tsx b/ui/src/components/AgentConfigForm.tsx index bc279ae9..683ce033 100644 --- a/ui/src/components/AgentConfigForm.tsx +++ b/ui/src/components/AgentConfigForm.tsx @@ -271,6 +271,7 @@ export function AgentConfigForm(props: AgentConfigFormProps) { // Section toggle state — advanced always starts collapsed const [adapterAdvancedOpen, setAdapterAdvancedOpen] = useState(false); + const [runPolicyAdvancedOpen, setRunPolicyAdvancedOpen] = useState(false); const [heartbeatOpen, setHeartbeatOpen] = useState(!isCreate); const [cwdPickerNotice, setCwdPickerNotice] = useState(null); @@ -380,35 +381,34 @@ export function AgentConfigForm(props: AgentConfigFormProps) { }} /> + {isLocal && ( + + mark("adapterConfig", "promptTemplate", v || undefined)} + placeholder="You are agent {{ agent.name }}. Your role is {{ agent.role }}..." + contentClassName="min-h-[88px] text-sm font-mono" + imageUploadHandler={async (file) => { + const namespace = `agents/${props.agent.id}/prompt-template`; + const asset = await uploadMarkdownImage.mutateAsync({ file, namespace }); + return asset.contentPath; + }} + /> + + )} )} - {/* ---- Adapter type ---- */} -
- - { - if (isCreate) { - set!({ adapterType: t, model: "", thinkingEffort: "" }); - } else { - setOverlay((prev) => ({ - ...prev, - adapterType: t, - adapterConfig: {}, // clear adapter config when type changes - })); - } - }} - /> - -
- - {/* ---- Adapter Configuration ---- */} + {/* ---- Adapter ---- */}
- Adapter Configuration + Adapter
+ + { + if (isCreate) { + set!({ adapterType: t, model: "", thinkingEffort: "" }); + } else { + setOverlay((prev) => ({ + ...prev, + adapterType: t, + adapterConfig: {}, // clear adapter config when type changes + })); + } + }} + /> + + {testEnvironment.error && (
{testEnvironment.error instanceof Error @@ -491,30 +508,16 @@ export function AgentConfigForm(props: AgentConfigFormProps) { )} - {/* Prompt template */} - {isLocal && ( - + {/* Prompt template (create mode only — edit mode shows this in Identity) */} + {isLocal && isCreate && ( + - isCreate - ? set!({ promptTemplate: v }) - : mark("adapterConfig", "promptTemplate", v || undefined) - } + value={val!.promptTemplate} + onChange={(v) => set!({ promptTemplate: v })} placeholder="You are agent {{ agent.name }}. Your role is {{ agent.role }}..." contentClassName="min-h-[88px] text-sm font-mono" imageUploadHandler={async (file) => { - const namespace = isCreate - ? "agents/drafts/prompt-template" - : `agents/${props.agent.id}/prompt-template`; + const namespace = "agents/drafts/prompt-template"; const asset = await uploadMarkdownImage.mutateAsync({ file, namespace }); return asset.contentPath; }} @@ -686,10 +689,10 @@ export function AgentConfigForm(props: AgentConfigFormProps) { )}
- {/* ---- Heartbeat Policy ---- */} + {/* ---- Run Policy ---- */} {isCreate ? ( } open={heartbeatOpen} onToggle={() => setHeartbeatOpen(!heartbeatOpen)} @@ -714,7 +717,7 @@ export function AgentConfigForm(props: AgentConfigFormProps) {
- Heartbeat Policy + Run Policy
- - {/* Edit-only: wake-on-* and cooldown */} -
-
- Advanced -
+
+ setRunPolicyAdvancedOpen(!runPolicyAdvancedOpen)} + > +
-
+
)}