feat: UX Cleanup & Critical TaskBeat Fix

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.
This commit is contained in:
pdyde 2026-02-21 15:04:22 +01:00
parent c949c04a5c
commit 50c1a0315b
3 changed files with 34 additions and 100 deletions

View file

@ -16,63 +16,23 @@
<div class="row g-4">
<!-- Sidebar -->
<div class="col-lg-4">
<!-- Task Distribution -->
<div class="card mb-3">
<div class="card-header bg-info">
<h5 class="mb-0">📋 Tasks verteilen</h5>
</div>
<div class="card-body">
<div class="mb-3">
<label class="form-label">Aufgaben (eine pro Zeile)</label>
<textarea class="form-control" id="todoPrompt" rows="4" placeholder="Recherche Location&#10;Catering planen&#10;Pressemitteilung schreiben"></textarea>
</div>
<div class="mb-3">
<label class="form-label">Agenten auswählen</label>
<div id="agentCheckboxes">
{% for key, agent in agents.items() %}
<div class="form-check">
<input class="form-check-input agent-checkbox" type="checkbox" value="{{ key }}" id="agent_{{ key }}" checked>
<label class="form-check-label" for="agent_{{ key }}">{{ agent.name }}</label>
</div>
{% endfor %}
</div>
</div>
<button type="button" class="btn btn-info w-100" onclick="distributeTodos()">Tasks parallel ausführen</button>
<div id="todoStatus" class="form-text mt-2"></div>
</div>
</div>
<div class="card mb-3">
<div class="card-header bg-dark">
<h5 class="mb-0">Prompt eingeben</h5>
</div>
<div class="card-body">
<form id="promptForm" method="POST" action="/orchestrator">
<div class="mb-3">
<label for="prompt" class="form-label">Ihre Anfrage</label>
<textarea class="form-control" id="prompt" name="prompt" rows="5"
placeholder="Was soll erledigt werden?" required></textarea>
</div>
<button type="button" class="btn btn-primary w-100 mb-2" id="streamBtn"
onclick="sendPromptWithStream()">Live-Antwort anfordern</button>
<button type="submit" class="btn btn-secondary w-100">Klassisch senden</button>
</form>
</div>
</div>
<div class="card">
<div class="card-header bg-secondary">
<h6 class="mb-0">Aktive Agenten</h6>
<div class="card-header bg-dark">
<h5 class="mb-0">💬 Prompt eingeben</h5>
</div>
<div class="card-body p-0">
<ul class="list-group list-group-flush">
{% for key, agent in agents.items() %}
<li class="list-group-item d-flex justify-content-between align-items-center">
<span style="font-size:.85rem;">{{ agent.name }}</span>
<span class="badge bg-success" style="font-size:.65rem;">aktiv</span>
</li>
{% endfor %}
</ul>
<div class="card-body">
<div class="mb-3">
<label for="prompt" class="form-label">Ihre Anfrage an den Orchestrator</label>
<textarea class="form-control" id="prompt" name="prompt" rows="8"
placeholder="Was soll erledigt werden?&#10;&#10;Beispiele:&#10;- Recherchiere Locations für den Diversity Ball&#10;- Erstelle eine Budget-Übersicht&#10;- Verteile diese Tasks an passende Agenten" required></textarea>
</div>
<button type="button" class="btn btn-primary w-100" id="streamBtn"
onclick="sendPromptWithStream()">
▶ Live-Antwort anfordern
</button>
<p class="form-text mt-2">
Der Orchestrator analysiert deine Anfrage und delegiert automatisch an die passenden Agenten.
</p>
</div>
</div>
</div>