From 845a2da4e2e3242b5edf6abc65e2f8baf138205d Mon Sep 17 00:00:00 2001 From: Mery-Sanz Date: Mon, 16 Jun 2025 12:56:45 +0200 Subject: [PATCH] fix toolbar error --- src/cai/repl/commands/memory.py | 3 ++- src/cai/repl/ui/toolbar.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cai/repl/commands/memory.py b/src/cai/repl/commands/memory.py index 67c6bfd6..f69c8600 100644 --- a/src/cai/repl/commands/memory.py +++ b/src/cai/repl/commands/memory.py @@ -906,7 +906,8 @@ Model: {get_compact_model() or os.environ.get("CAI_MODEL", "gpt-4")} # Register the memory in the index self._register_memory(memory_id, memory_name) - + + os.environ['CAI_MEMORY'] = 'true' console.print(f"[green]✓ Saved memory: {memory_name} (ID: {memory_id})[/green]") # Automatically apply the memory to the agent's system prompt diff --git a/src/cai/repl/ui/toolbar.py b/src/cai/repl/ui/toolbar.py index b073dc75..06b1e70f 100644 --- a/src/cai/repl/ui/toolbar.py +++ b/src/cai/repl/ui/toolbar.py @@ -157,8 +157,8 @@ def update_toolbar_in_background(): auto_compact_color = "ansired" # Get memory status - memory_enabled = os.getenv('CAI_MEMORY', 'false').lower() != 'false' - memory_str = os.getenv('CAI_MEMORY', 'false') if memory_enabled else "✗" + memory_enabled = os.getenv('CAI_MEMORY', 'false').lower() == 'true' + memory_str = "✓" if memory_enabled else "✗" memory_color = "ansigreen" if memory_enabled else "ansigray" # Get streaming status