fix: rimuove virgolette dai fatti salvati nella memoria

- Aggiunta funzione _clean_text() per pulire le virgolette
- Corretto memory_remember per salvare testo pulito
This commit is contained in:
opencode committed 2026-03-23 09:41:46 +01:00
1 parent d055204067
commit 05fc002cb4
1 file changed
+11 -2
+11 -2
View File
@@ -649,9 +649,14 @@ def memory_remember(text: str):
"""Remember a fact for future reference"""
from enhancements.simple_memory import simple_memory
try:
# Clean the text - remove any quotes
clean_text = _clean_text(text)
if not clean_text:
print("❌ Errore: il testo non può essere vuoto")
return
# Default category is "general"
simple_memory.add_fact(text, "general")
print(f"✅ Remembered: {text[:100]}{'...' if len(text) > 100 else ''}")
simple_memory.add_fact(clean_text, "general")
print(f"✅ Remembered: {clean_text[:100]}{'...' if len(clean_text) > 100 else ''}")
except Exception as e:
print(f"❌ Error remembering: {e}")
@@ -723,6 +728,10 @@ def _strip_quotes(s: str) -> str:
return s[1:-1]
return s
def _clean_text(s: str) -> str:
"""Remove all quotes (single and double) from a string"""
return s.replace('"', '').replace("'", '').strip()
def plan_create(name: str, tasks_string: str):
"""Create a plan with multiple tasks"""
from enhancements.planning_enhancement import enhanced_planner