- get_tasks(): ORDER BY id ASC (oldest first) for TaskBeat FIFO processing
- UI calls use order='desc' so display stays newest-first
- trigger_daily_standup(): standup sub-tasks now stored as type='standup_reply'
with telegram_chat_id set correctly so replies can be matched
- telegram_message_handler: checks for open standup_reply task from same
chat_id before creating new task - if found, marks standup complete and
creates orchestrator follow-up task with full context to process the reply
- tasks.html: badge for standup_reply type
- DailyStandupBeat thread fires at 09:00 every day
- trigger_daily_standup(): messages all team members, orchestrator updates KB + agent reminders
- broadcast_knowledge_update(): distributes any new info to all agents immediately
- parse_agent_commands(): add <update_knowledge> and <update_agent_reminder> XML handlers
- /api/standup/trigger and /api/broadcast routes for manual triggering
- orchestrator systemprompt: standup + broadcast instructions with examples
- tasks.html: badges for standup / broadcast / action_knowledge task types
Root cause: opencode/Claude Code recognizes the Frankenbot repo context from CLAUDE.md
and refuses to output @CREATE_SUBTASK, @SEND_EMAIL etc. as they look like 'system
directives'. XML tags (<create_task>, <send_email>, etc.) work reliably.
- parse_agent_commands(): full rewrite with XML tag parser, supports both
XML child tags and key: value fields within blocks
- build_agent_prompt(): command docs updated to XML format with code examples
- orchestrator/systemprompt.md: rewritten with XML action examples
- ar_manager/systemprompt.md: @ASK_ORCHESTRATOR -> <ask_orchestrator>
Old prompt had no instructions for when/how to use @CREATE_SUBTASK during chat,
no list of available agents by key name, and no guidance on handling conversational
messages. Orchestrator was answering questions but never creating tasks or taking
actions autonomously.
Every parsed agent command now creates a task entry with type action_email /
action_telegram / action_team, parent_task_id pointing to the originating task,
and status completed/error reflecting the actual outcome.
Tasks UI gets matching badges for all new types plus a parent-task indicator
(↳ #N) so the full chain from trigger to action is visible at a glance.
The /chat/send SSE stream was building a stripped-down system prompt
without any Frankenbot command documentation (@CREATE_SUBTASK, @SEND_EMAIL,
@SEND_TELEGRAM etc.), so agents never knew to emit these commands during
web chat sessions — tasks were never created, emails never sent.
Extract build_agent_prompt() as shared function used by both
execute_agent_task() and the streaming chat generator.
- @SEND_TELEGRAM: fix regex To: -> TelegramID:, fix DB lookup telegram_chat_id -> telegram_id,
use send_telegram_message() (sync HTTP) instead of asyncio.run(), support direct numeric IDs
- @ADD_TEAM_MEMBER: fix field order in regex (Name/Role/Responsibilities/Email) to match prompt
- System prompt: document all Claude Code built-in tools (WebFetch, Read, Write, Edit,
Glob, Grep, Bash) so agents know what is available, clean up command documentation
- Add sent_emails table to DB for persistent outbox logging
- send_email() now writes every outgoing mail (incl. errors) to sent_emails
- parse_agent_commands() passes agent_key/task_id as triggered_by metadata
- Fix @UPDATE_TEAM_MEMBER parser: now matches Identifier/TelegramID/Role/etc.
format from system prompt (was expecting Email/Field/Value — never matched)
- update_team_member() called correctly via **kwargs (was positional args bug)
- Set Piotr telegram_id=1578034974 directly in DB
- email_log.html: two-tab UI (Inbox Journal + Outbox), click-to-expand body
- emails.html: per-message delete button in inbox list
- New routes: DELETE inbox (IMAP expunge), journal entry, sent entry
- Wire up Telegram bot with token, allowed users and username from .env
- Fix TaskBeat to handle direct tasks (Telegram/email) without sub_tasks
- Fix send_telegram_message to use run_coroutine_threadsafe (avoid event loop clash)
- Add TaskBeat watchdog thread for auto-restart on crash
- Reset stuck in_progress tasks on startup
- Add task detail page (/tasks/<id>) with full response/log view and auto-refresh
- Add task delete route (/tasks/delete/<id>) with confirmation
- Include agent sender info in Telegram task prompts
- Orchestrator self-updated knowledge base with Telegram contact info
- App-level password auth via Flask session (APP_PASSWORD in .env)
- login_required decorator on all routes
- Login page, logout button in navbar, 7-day session lifetime
- Upgrade musik_rechte_advisor and negotiator from Opus 4.0 to Opus 4.6
- Fix orchestrator session cookie overflow (kb/prompts no longer stored in session)
- Change app port from 5000 to 5050 (5000 occupied by Zou/Kitsu)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add task creation notifications in Orchestrator Chat
- New messages appear at top (newest first)
- Add Clear Chat button with confirmation
- Improve timestamps: DD.MM.YYYY HH:MM:SS format
- Support for system notifications (task created, sub-agent responses)
- Add add_orchestrator_notification() helper function
- Auto-notify when agents create sub-tasks
- Clear Chat route: POST /orchestrator/clear
- Better visual distinction between messages and notifications
- Move knowledge base from root to agents/orchestrator/knowledge/
- Move orphaned files (AKM, Event-Plan) to orchestrator/work/
- Update all kb_file paths to new location
- Change orchestrator stream to use work_dir instead of root
- Now ALL agents (including orchestrator) work in their own folders
- No more files created in project root
- Consistent work directory behavior across all agents
- 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
- Replace blocking execute_agent_task() with live subprocess streaming
- Use Popen() to read opencode output line-by-line in real-time
- Send 'chunk' events to frontend as agent thinks
- Frontend appends chunks incrementally for live response
- Matches Orchestrator's streaming UX
- No more waiting for complete response before seeing output
- Replace hardcoded 'Frankenbot' in footer with {{ app_name }}
- Footer now reflects custom app name from settings
- Consistent branding across navigation, title, and footer
- Change Dark Mode accent from blue to purple (#a855f7)
- Balance dark backgrounds to match Light Mode structure
- bg-base: #1a1a1a (was #0f0f0f - too dark)
- bg-surface: #212121 (more balanced)
- Improved contrast and readability
- Update borders to be more visible (12% vs 8% opacity)
- Adjust agent colors for purple theme:
- Orchestrator: Purple
- Researcher: Green
- Negotiator: Orange
- AR Manager: Yellow
- Update Settings description: 'Violett' instead of 'Blau'
- Dark Mode now mirrors Light Mode balance (just inverted)
- Replace hardcoded #a5f3fc (bright blue) with var(--code-text)
- Now respects dark mode (#d4d4d4) and light mode (#404040)
- Fixes unreadable text in file preview modal
- Dark Mode: Use soft light gray (#d4d4d4) instead of bright blue
- Light Mode: Use dark gray (#404040) for good contrast
- Add subtle border for better code block definition
- Remove hacky bright blue color that was unreadable in light mode
Problem:
- Task #1 was stuck in 'in_progress' status
- TaskBeat expects 'sub_tasks' array for orchestrated tasks
- Tasks created via old API didn't have sub_tasks defined
- TaskBeat only processes 'pending' tasks, so in_progress tasks stay stuck
Solution:
- Added validation: if orchestrated task has no sub_tasks, mark as completed with error message
- Prevents infinite loop with stuck tasks
- Manually completed Task #1 in database
Note: This handles legacy tasks from deprecated /api/orchestrate endpoint.
Agent Color System:
- Added unique colors for each agent (orchestrator: purple, researcher: teal, negotiator: red, ar_manager: yellow)
- CSS variables and utility classes (.agent-*, .agent-badge-*, .agent-border-*)
- Tasks table now shows colored left border per agent
- Agent names displayed in their brand color
Navigation Simplification:
- Removed 'Email Log' from main menu (reduced clutter)
- Email Log now accessible via link in Emails page
- Active state for both /emails and /email-log on Emails nav item
Visual Improvements:
- Agent assignments now visually distinct at a glance
- Cleaner, more focused navigation menu
- Better information architecture
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.
Changed all 'files_page' to 'files' in redirect calls:
- delete_agent_file() - 4 occurrences
- delete_project_file() - 4 occurrences
Fixes Internal Server Error (500) when deleting files.
Error was: BuildError: Could not build url for endpoint 'files_page'
Corrected team member roles and responsibilities:
- Eric Fischer: Programmer → Funktionserweiterung
- Georg Tschare: CEO → Personalmanagement, Kundenkommunikation, Kommunikation mit Behörden
- Piotr Dyderski: Tech, 3D Art, RnD → Technische Infrastruktur, AI-Agenten, Automatisierung, 3D Avatare, Research and Development
DB data is the source of truth, code now matches.
- Edit modal with Bootstrap for inline editing
- Update name, email, role, responsibilities, telegram_id
- Form validation and error handling
- Success/error flash messages
- Team member data passed to frontend via JSON
- New /team route to view all team members
- Add/activate/deactivate team members via UI
- Display name, role, email, responsibilities, telegram_id
- Integrated into main navigation
- Self-learning system info displayed
- Add command parsing for @SEND_EMAIL, @SEND_TELEGRAM, @UPDATE_TEAM_MEMBER, @ADD_TEAM_MEMBER
- Migrate all tasks.append() calls (13 occurrences) to use create_task() for DB persistence
- Update task routes to read from database instead of in-memory array
- Orchestrator beat now executes parsed commands (email/telegram notifications)
- Maintain legacy task_queue compatibility for email processing
- All tasks now persist across app restarts
Team-Member Updates:
- Korrigierte Rollen und Verantwortlichkeiten:
* Eric Fischer: Lead Programming & Tech
* Georg Tschare: CEO & Kundenkommunikation
* Piotr Dyderski: SysAdmin, TechLead, 3D Artist & R&D
Neue Funktionen:
- update_team_member() - Aktualisiert Team-Member-Daten per Email/Name
- is_known_team_member() - Prüft ob Email in Team-DB existiert
- @UPDATE_TEAM_MEMBER Kommando für Orchestrator
- @ADD_TEAM_MEMBER Kommando für Orchestrator
Intelligentes Lernsystem:
- Erkennt neue Email-Absender automatisch
- Leitet unbekannte Absender automatisch an Orchestrator
- Orchestrator bittet um Vorstellung (Name, Rolle, Aufgaben)
- Informationen werden in Team-DB gespeichert
- Verbessert zukünftige Koordination
Email-Workflow für neue Absender:
1. Email von unbekanntem @diversityball.at kommt an
2. System erkennt: "Nicht in Team-DB"
3. Orchestrator übernimmt automatisch
4. Fragt freundlich nach Vorstellung
5. Beantwortet auch die eigentliche Anfrage
6. Speichert Infos mit @ADD_TEAM_MEMBER
Vorteile:
✓ Orchestrator baut automatisch Wissensdatenbank auf
✓ Bessere Koordination durch bekannte Verantwortlichkeiten
✓ Keine manuellen Team-Member Einträge nötig
✓ Freundlicher, professioneller Erstkontakt
✓ Lernfähiges System das besser wird
Context-Weiterleitung:
- extra_context aus Tasks wird jetzt durchgereicht
- Kombiniert Email-Kontext + Team-Member-Status
- Agents haben volle Informationen über Absender
Security Fixes:
- Fix XSS vulnerability in orchestrator.html (escapeHtml für user input)
- Verbesserte Error-Handling: 4 bare except clauses mit spezifischen Exception-Typen
Code Quality:
- Logging für alle Exception-Handler hinzugefügt
- Timeout für Agent-Tasks von 300s auf 600s erhöht (10 Min)
- Bessere Kommentare für Exception-Handling
Performance:
- Wissensdatenbank aus Systemprompt entfernt
- Agents nutzen @READ_KNOWLEDGE für on-demand Zugriff
- Reduziert Prompt-Größe um ~15KB pro Task
UI Improvements (aus vorherigem Work):
- Tasks: Auto-Refresh Info statt Toggle
- Tasks: Status-Anzeigen statt manuelle Buttons
- Konsistentes Auto-Refresh (15s) wenn Tasks aktiv