Skip to content

The open-source app everyone uses to manage agents at work

Fix file selection being reset when clicking entry file in tree

dotta6ba5758d307d
diff --git a/ui/src/pages/AgentDetail.tsx b/ui/src/pages/AgentDetail.tsx
index 621eb284a4..40c08ca8c0 100644
--- a/ui/src/pages/AgentDetail.tsx
+++ b/ui/src/pages/AgentDetail.tsx
@@ -1636,7 +1636,7 @@ function PromptsTab({
if (selectedFile !== bundle.entryFile) setSelectedFile(bundle.entryFile);
return;
}
- if (!availablePaths.includes(selectedFile)) {
+ if (!availablePaths.includes(selectedFile) && selectedFile !== currentEntryFile) {
setSelectedFile(availablePaths.includes(bundle.entryFile) ? bundle.entryFile : availablePaths[0]!);
}
}, [bundle, bundleMatchesDraft, currentEntryFile, selectedFile]);