From 25d349f1151be7d9f58a6847608ece2550c34854 Mon Sep 17 00:00:00 2001 From: Marco Gallegos Date: Thu, 18 Dec 2025 09:31:39 -0600 Subject: [PATCH] docs: Replace general development task tracking with a specific bot correction plan. --- tasks.md | 60 +++++++++++++++----------------------------------------- 1 file changed, 16 insertions(+), 44 deletions(-) diff --git a/tasks.md b/tasks.md index c7ccbb3..71d661d 100644 --- a/tasks.md +++ b/tasks.md @@ -1,50 +1,22 @@ -# Talía Development Tasks +# Plan de Corrección del Bot -This file tracks the development tasks for the Talía project. +Este plan detalla los pasos necesarios para que el bot sea funcional, responda a los botones y no se bloquee. -## Phase 1: Project Scaffolding +## 1. Corrección de Bloqueos (Agenda) +- [ ] **Hacer asíncronas las llamadas a Google Calendar**: En `app/main.py`, usar `asyncio.to_thread` o un ejecutor para las funciones que bloquean el hilo principal (como `get_agenda` que llama a `get_events`). +- [ ] **Optimizar `button_dispatcher`**: Asegurar que el despachador de botones maneje correctamente tanto funciones síncronas como asíncronas sin bloquearse. -- [x] Create `tasks.md` to track project development. -- [x] Create the basic directory structure (`app`, `app/modules`). -- [x] Create placeholder files in the root directory (`docker-compose.yml`, `Dockerfile`, `.env.example`). -- [x] Create placeholder files in the `app` directory. -- [x] Create placeholder files in the `app/modules` directory. +## 2. Corrección de Botones y Flujos (ConversationHandlers) +- [ ] **Vincular botones a conversaciones**: Modificar `app/modules/create_tag.py` y otros módulos para que sus `ConversationHandler` tengan como punto de entrada (`entry_points`) el `CallbackQueryHandler` del botón correspondiente. +- [ ] **Limpiar `button_dispatcher`**: Eliminar las llamadas manuales a inicios de conversación dentro del despachador, dejando que los `ConversationHandler` se encarguen de capturar sus propios botones. -## Phase 2: Core Logic Implementation +## 3. Robustez y Errores +- [ ] **Manejador Global de Errores**: Añadir `application.add_error_handler` en `app/main.py` para capturar cualquier fallo y loguearlo, evitando que el bot se quede "pensando" sin dar respuesta. +- [ ] **Verificación de Roles**: Asegurar que `onboarding.py` siempre entregue el menú correcto y que los IDs en `.env` estén bien cargados. -- [x] Implement `main.py` as the central orchestrator. -- [x] Implement `config.py` to handle environment variables. -- [x] Implement `permissions.py` for role-based access control. -- [x] Implement `webhook_client.py` for n8n communication. +## 4. Gestión de Procesos +- [ ] **Evitar Conflictos**: Implementar una verificación al inicio de `main.py` para asegurar que no haya otra instancia del bot corriendo con el mismo token. -## Phase 3: Module Implementation - -- [x] Implement `onboarding.py` module. -- [x] Implement `agenda.py` module. -- [x] Implement `citas.py` module. -- [x] Implement `equipo.py` module. -- [x] Implement `aprobaciones.py` module. -- [x] Implement `servicios.py` module. -- [x] Implement `admin.py` module. -- [x] Add `/print` command for authorized users. - -## Phase 4: Integrations - -- [x] Implement `calendar.py` for Google Calendar integration. -- [x] Implement `llm.py` for AI-powered responses. -- [x] Implement `scheduler.py` for daily summaries. - -## Log - -### 2024-05-22 - -- Created `tasks.md` to begin tracking development. -- Completed initial project scaffolding. -- Implemented the core logic for the bot, including the central orchestrator, permissions, and onboarding. -- Implemented the `agenda` and `citas` modules. -- Implemented the conversational flow for proposing and approving activities. -- Completed Phase 3 by implementing all modules and refactoring the main dispatcher. - -### 2024-05-23 - -- Add `/print` command for authorized users. +## 5. Verificación Final +- [ ] Probar cada botón del menú Admin: Agenda, Pendientes, Crear Tag, Más opciones. +- [ ] Verificar que el bot responda "No hay eventos" o la lista de eventos sin colgarse.