Fix instructions tab state on agent switch

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
dotta 2026-03-23 20:30:18 -05:00
parent eeb7e1a91a
commit a346ad2a73

View file

@ -998,6 +998,7 @@ export function AgentDetail() {
{activeView === "instructions" && (
<PromptsTab
key={agent.id}
agent={agent}
companyId={resolvedCompanyId ?? undefined}
onDirtyChange={setConfigDirty}
@ -1617,6 +1618,20 @@ function PromptsTab({
selectedFile: string;
} | null>(null);
useEffect(() => {
setSelectedFile("AGENTS.md");
setShowFilePanel(false);
setDraft(null);
setBundleDraft(null);
setNewFilePath("");
setShowNewFileInput(false);
setPendingFiles([]);
setExpandedDirs(new Set());
setAwaitingRefresh(false);
lastFileVersionRef.current = null;
externalBundleRef.current = null;
}, [agent.id]);
const isLocal =
agent.adapterType === "claude_local" ||
agent.adapterType === "codex_local" ||