From 09f095dc5632a7d10b19ecf20c340c322c99c0f9 Mon Sep 17 00:00:00 2001 From: laurentbarontini Date: Mon, 27 Apr 2026 17:16:14 +0200 Subject: [PATCH] Bug task without id --- app.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index d989301..282ef0b 100644 --- a/app.py +++ b/app.py @@ -192,8 +192,16 @@ def construire_contexte_memoire(session_id=None): if contexte.get("last_project"): lignes.append(f"- dernier projet mentionne : {contexte['last_project']}") if contexte.get("tasks"): - ids = ", ".join(f"#{tache['id']} {tache['title']}" for tache in contexte["tasks"][:5]) - lignes.append(f"- dernieres taches affichees : {ids}") + taches_affichees = [] + 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( "Utilise ce contexte pour repondre aux questions globales. "