feat(agent): add learn action flow and grounding guards

This commit is contained in:
Dom
2026-06-02 16:24:10 +02:00
parent 86b3c8f7e7
commit d38f0b0f2f
39 changed files with 5901 additions and 212 deletions

View File

@@ -121,10 +121,7 @@ class AgentV1:
# Wiring ChatWindow → Executor pour Plan B (pause_message → bulle interactive)
# Permet à l'executor d'afficher une bulle paused dans la fenêtre Léa V1
# quand le serveur signale replay_paused=True via /replay/next.
try:
self._executor._chat_window_ref = self._chat_window
except Exception:
logger.debug("Wiring chat_window→executor échoué (non bloquant)", exc_info=True)
self._wire_chat_window_to_executor()
# Boucles permanentes (pas besoin de session active)
self.running = True
@@ -154,6 +151,15 @@ class AgentV1:
shared_state=self._state,
)
def _wire_chat_window_to_executor(self) -> None:
"""Relie l'executor courant à la ChatWindow pour les pauses supervisees."""
if self._executor is None or self._chat_window is None:
return
try:
self._executor._chat_window_ref = self._chat_window
except Exception:
logger.debug("Wiring chat_window->executor echoue (non bloquant)", exc_info=True)
def _delayed_cleanup(self):
"""Nettoyage en arrière-plan après 30s pour ne pas bloquer le démarrage."""
time.sleep(30)
@@ -224,6 +230,7 @@ class AgentV1:
# Initialiser l'executeur partage
self._executor = ActionExecutorV1()
self._wire_chat_window_to_executor()
self.shot_counter = 0
self.running = True