Bug task without id

This commit is contained in:
2026-04-27 17:16:14 +02:00
parent 9edba16a4e
commit 09f095dc56

12
app.py
View File

@@ -192,8 +192,16 @@ def construire_contexte_memoire(session_id=None):
if contexte.get("last_project"): if contexte.get("last_project"):
lignes.append(f"- dernier projet mentionne : {contexte['last_project']}") lignes.append(f"- dernier projet mentionne : {contexte['last_project']}")
if contexte.get("tasks"): if contexte.get("tasks"):
ids = ", ".join(f"#{tache['id']} {tache['title']}" for tache in contexte["tasks"][:5]) taches_affichees = []
lignes.append(f"- dernieres taches affichees : {ids}") for tache in contexte["tasks"][:5]:
titre = tache.get("title") or tache.get("titre") or tache.get("task_title") or tache.get("tache")
identifiant = tache.get("id")
if titre and identifiant is not None:
taches_affichees.append(f"#{identifiant} {titre}")
elif titre:
taches_affichees.append(str(titre))
if taches_affichees:
lignes.append(f"- dernieres taches affichees : {', '.join(taches_affichees)}")
lignes.append( lignes.append(
"Utilise ce contexte pour repondre aux questions globales. " "Utilise ce contexte pour repondre aux questions globales. "