From 657ad98e75128ed712f0a66dc3cb1049c5e778b9 Mon Sep 17 00:00:00 2001
From: ValueOn AG
Date: Tue, 6 Jan 2026 17:35:51 +0100
Subject: [PATCH] fixed looping bug
---
modules/services/serviceAi/subAiCallLooping.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/modules/services/serviceAi/subAiCallLooping.py b/modules/services/serviceAi/subAiCallLooping.py
index 31cca318..f8eef9b9 100644
--- a/modules/services/serviceAi/subAiCallLooping.py
+++ b/modules/services/serviceAi/subAiCallLooping.py
@@ -415,10 +415,11 @@ class AiCallLooper:
# STEP 5: GET CONTEXTS (merge OK, parse failed = cut JSON)
# Use candidateJson for context extraction
contexts = getContexts(candidateJson)
+ overlapInfo = "(empty=complete)" if contexts.overlapContext == "" else f"({len(contexts.overlapContext)} chars)"
logger.debug(
f"Iteration {iteration}: getContexts() -> "
f"jsonParsingSuccess={contexts.jsonParsingSuccess}, "
- f"overlapContext={'\"\"' if not contexts.overlapContext else f'({len(contexts.overlapContext)} chars)'}"
+ f"overlapContext={overlapInfo}"
)
# STEP 6: DECIDE based on jsonParsingSuccess and overlapContext