From 38185448324351f79b6f89657053c01ca5d83851 Mon Sep 17 00:00:00 2001 From: OpenSquared Date: Wed, 17 Jun 2026 09:15:12 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20auto=5Fcycle=20=E2=80=94=20NameError=20'?= =?UTF-8?q?meaningful'=20+=20Super=20Contexte=20bloqu=C3=A9=20par=20gate?= =?UTF-8?q?=20rapport?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix NameError: len(meaningful) → len(meaningful_mature) (ligne 624) - _auto_synthesize_knowledge() appelé même si pas assez de trades matures, pour que le Super Contexte se mette à jour à chaque cycle (gate 6h suffit) Co-Authored-By: Claude Sonnet 4.6 --- backend/services/auto_cycle.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/services/auto_cycle.py b/backend/services/auto_cycle.py index c6742a0..a0b1cb4 100644 --- a/backend/services/auto_cycle.py +++ b/backend/services/auto_cycle.py @@ -535,6 +535,8 @@ def _auto_portfolio_snapshot(ai_key: str) -> None: f"with meaningful P&L (need ≥ 2). " f"Immatures={len(trop_tot)}, en cours={len(en_cours)}, matures={len(matures)}" ) + # Still try to refresh Super Contexte (independent of portfolio report) + _auto_synthesize_knowledge(ai_key) return # Sort matures by P&L for the report @@ -622,7 +624,7 @@ Génère un rapport JSON basé UNIQUEMENT sur les trades matures : ) logger.info( f"[AutoSnapshot] Portfolio report #{report_id} saved automatically " - f"({len(meaningful)} meaningful trades, avg P&L {avg_str})" + f"({len(meaningful_mature)} meaningful mature trades, avg P&L {avg_str})" ) # ── Auto-synthesize Super Contexte if stale (>6h or never generated) ──