From 4c0366341835618fdf7c37d4ae3bf94e450c3344 Mon Sep 17 00:00:00 2001 From: pdyde Date: Sat, 21 Feb 2026 17:42:54 +0100 Subject: [PATCH] fix: Reload AGENTS dict when agent is deleted - Add global AGENTS reload after agent deletion - Ensures agent immediately disappears from all dropdowns/UIs - Matches agent creation behavior (which already reloads) - Fixes issue where deleted agents still appeared in chat/task forms --- app.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app.py b/app.py index 0b6d80f..e92e5d4 100644 --- a/app.py +++ b/app.py @@ -3137,6 +3137,11 @@ def delete_agent(agent_name): with open(AGENT_CONFIG_FILE, 'w', encoding='utf-8') as f: json.dump(config, f, indent=2) + # AGENTS Dictionary neu laden + global AGENTS + AGENTS = load_agents_from_directories() + + logger.info(f"[AgentDelete] Agent gelöscht: {agent_name}") return jsonify({'success': True, 'message': f'Agent "{agent_name}" wurde gelöscht.'}) except Exception as e: return jsonify({'error': str(e)}), 500