diff --git a/frontend/src/pages/AgentsPage.tsx b/frontend/src/pages/AgentsPage.tsx index 0a766607..c388a032 100644 --- a/frontend/src/pages/AgentsPage.tsx +++ b/frontend/src/pages/AgentsPage.tsx @@ -1,4 +1,5 @@ import { useEffect, useState, useCallback, useRef } from 'react'; +import ReactMarkdown from 'react-markdown'; import { toast } from 'sonner'; import { useAppStore } from '../lib/store'; import { @@ -798,13 +799,65 @@ function AgentCard({ // Detail view — Configuration grid with editable model // --------------------------------------------------------------------------- +function AgentInstructionSection({ agent, onAgentUpdated }: { agent: ManagedAgent; onAgentUpdated: () => void }) { + const [editing, setEditing] = useState(false); + const [draft, setDraft] = useState(''); + const currentInstruction = (agent.config?.instruction as string) || ''; + + async function save() { + try { + const newConfig = { ...(agent.config || {}), instruction: draft.trim() }; + await updateManagedAgent(agent.id, { config: newConfig }); + onAgentUpdated(); + } catch { /* ignore */ } + setEditing(false); + } + + return ( +
+
+

Instruction

+ {!editing && ( + + )} +
+ {editing ? ( +
+