From 50c1a0315b8305f4a0c57a889b770d876af98a99 Mon Sep 17 00:00:00 2001 From: pdyde Date: Sat, 21 Feb 2026 15:04:22 +0100 Subject: [PATCH] feat: UX Cleanup & Critical TaskBeat Fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UX Improvements: - Tasks page: Remove 'Create new task' form (orchestrator handles all) - Orchestrator: Simplified to single 'Prompt' section, removed 'Tasks verteilen' - Orchestrator: Removed 'Klassisch senden' button (live-only responses) - Orchestrator: Removed 'Aktive Agenten' display (redundant with dashboard) Critical Fix: - TaskBeat now reads pending tasks from DATABASE instead of in-memory array - All status updates (pending→in_progress→completed) now persist to DB - Fixes issue where tasks created via API/UI were not being processed - Agent_key updates also synced to DB This fixes the bug where Task #1 was stuck in pending status. --- app.py | 19 +++++++++- templates/orchestrator.html | 70 ++++++++----------------------------- templates/tasks.html | 45 +----------------------- 3 files changed, 34 insertions(+), 100 deletions(-) diff --git a/app.py b/app.py index 3d67b78..fce9e54 100644 --- a/app.py +++ b/app.py @@ -1889,12 +1889,20 @@ def process_beat_tasks(): while True: try: - pending_tasks = [t for t in tasks if t.get('status') == 'pending' and t.get('type') in ('agent_created', 'manual', 'orchestrated', 'agent_delegated')] + # Lade pending Tasks aus Datenbank + db_tasks = get_tasks(status='pending') + # Konvertiere zu Dict-Format für Legacy-Kompatibilität + pending_tasks = [] + for db_task in db_tasks: + if db_task.get('type') in ('agent_created', 'manual', 'orchestrated', 'agent_delegated', 'telegram'): + pending_tasks.append(db_task) for task in pending_tasks: agent_key = task.get('agent_key') or task.get('assigned_agent', '') if task.get('agent_key') == 'orchestrator': + # Update in DB + update_task_db(task['id'], status='in_progress') task['status'] = 'in_progress' logger.info("[TaskBeat] Planungsphase für Task #%d", task['id']) @@ -1953,6 +1961,8 @@ Arbeite diesen Teil ab und liefere ein vollständiges Ergebnis.""", created_sub_tasks.append(sub_task_id) logger.info("[TaskBeat] Sub-Task #%d zugewiesen an %s", sub_task_id, assigned) + # Update in DB + update_task_db(task['id'], status='completed') task['status'] = 'completed' task['sub_task_ids'] = created_sub_tasks logger.info("[TaskBeat] Planungs-Task #%d abgeschlossen. %d Sub-Tasks erstellt.", task['id'], len(created_sub_tasks)) @@ -1963,13 +1973,18 @@ Arbeite diesen Teil ab und liefere ein vollständiges Ergebnis.""", if available_agents: agent_key = available_agents[0] task['agent_key'] = agent_key + update_task_db(task['id'], agent_key=agent_key) if agent_key and agent_key in AGENTS: + # Update in DB + update_task_db(task['id'], status='in_progress') task['status'] = 'in_progress' logger.info("[TaskBeat] Verarbeite Task #%d – Agent: %s", task['id'], agent_key) response = execute_agent_task(agent_key, task.get('title', '') + '\n\n' + task.get('description', '')) + # Update in DB + update_task_db(task['id'], response=response) task['response'] = response # Neues Memory-System: Task als strukturierte Erinnerung speichern @@ -1988,6 +2003,8 @@ Arbeite diesen Teil ab und liefere ein vollständiges Ergebnis.""", except Exception as e: logger.warning("[TaskBeat] Konnte Erinnerung nicht speichern: %s", str(e)) + # Update in DB + update_task_db(task['id'], status='completed') task['status'] = 'completed' logger.info("[TaskBeat] Task #%d abgeschlossen.", task['id']) diff --git a/templates/orchestrator.html b/templates/orchestrator.html index 0149a3d..301f532 100644 --- a/templates/orchestrator.html +++ b/templates/orchestrator.html @@ -16,63 +16,23 @@
- -
-
-
📋 Tasks verteilen
-
-
-
- - -
-
- -
- {% for key, agent in agents.items() %} -
- - -
- {% endfor %} -
-
- -
-
-
- -
-
-
Prompt eingeben
-
-
-
-
- - -
- - -
-
-
-
-
-
Aktive Agenten
+
+
💬 Prompt eingeben
-
-
    - {% for key, agent in agents.items() %} -
  • - {{ agent.name }} - aktiv -
  • - {% endfor %} -
+
+
+ + +
+ +

+ Der Orchestrator analysiert deine Anfrage und delegiert automatisch an die passenden Agenten. +

diff --git a/templates/tasks.html b/templates/tasks.html index 8d6cdef..3bd05a7 100644 --- a/templates/tasks.html +++ b/templates/tasks.html @@ -8,50 +8,7 @@
-
-
-
-
Neuen Task erstellen
-
-
-
-
- - -
-
- - -
-
- - -
- -
-
-
- -
-
-
ℹ️ Info
-
-
-

- Tasks werden automatisch alle 10 Sekunden vom TaskBeat verarbeitet. -
Diese Seite aktualisiert sich automatisch alle 15 Sekunden wenn Tasks aktiv sind. -

-
-
-
- -
+
Alle Tasks