From 35249b4cb4979101eb76ebdbc85119bade535be5 Mon Sep 17 00:00:00 2001 From: Jon Saad-Falcon <41205309+jonsaadfalcon@users.noreply.github.com> Date: Fri, 27 Mar 2026 13:33:42 -0700 Subject: [PATCH] fix: markdown rendering in Interact, separate instruction section 1. Agent responses in Interact tab now render as markdown (headers, bold, lists, etc.) instead of raw text with ** and ## 2. Instruction section is its own box above Configuration in Overview 3. Edit button is inline next to "Instruction" heading 4. User messages stay as plain text (no markdown needed) Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/src/pages/AgentsPage.tsx | 128 ++++++++++++++++-------------- 1 file changed, 70 insertions(+), 58 deletions(-) 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 ? ( +
+