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
This commit is contained in:
parent
e2a853ffde
commit
4c03663418
1 changed files with 5 additions and 0 deletions
5
app.py
5
app.py
|
|
@ -3137,6 +3137,11 @@ def delete_agent(agent_name):
|
||||||
with open(AGENT_CONFIG_FILE, 'w', encoding='utf-8') as f:
|
with open(AGENT_CONFIG_FILE, 'w', encoding='utf-8') as f:
|
||||||
json.dump(config, f, indent=2)
|
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.'})
|
return jsonify({'success': True, 'message': f'Agent "{agent_name}" wurde gelöscht.'})
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return jsonify({'error': str(e)}), 500
|
return jsonify({'error': str(e)}), 500
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue