fix: prevent agent deletion from disabling built-ins

Stop delete from creating disable overrides
Delete only the selected agent scope
Keep web and VS Code behavior aligned
This commit is contained in:
Bohdan Triapitsyn
2026-06-16 13:38:24 +03:00
parent e402cd75f5
commit e982bd9388
6 changed files with 113 additions and 58 deletions
@@ -181,7 +181,7 @@ export const AgentsSidebar: React.FC<AgentsSidebarProps> = ({ onItemSelect }) =>
}
setIsConfirmActionPending(true);
const success = await deleteAgent(confirmActionAgent.name);
const success = await deleteAgent(confirmActionAgent.name, (confirmActionAgent as Agent & { scope?: AgentScope }).scope);
if (success) {
if (confirmActionType === 'delete') {
@@ -276,7 +276,7 @@ export const AgentsSidebar: React.FC<AgentsSidebarProps> = ({ onItemSelect }) =>
if (success) {
// Delete old agent
const deleteSuccess = await deleteAgent(renameDialogAgent.name);
const deleteSuccess = await deleteAgent(renameDialogAgent.name, renameExt.scope);
if (deleteSuccess) {
toast.success(`Agent renamed to "${sanitizedName}"`);
setSelectedAgent(sanitizedName);