Merge branch 'toolbar_memory' into '0.5.0'

Toolbar memory issue

See merge request aliasrobotics/alias_research/cai!219
This commit is contained in:
Luis Javier Navarrete Lozano 2025-06-16 11:46:07 +00:00
commit 17047b6093
2 changed files with 7 additions and 4 deletions

View File

@ -438,6 +438,7 @@ Model: {get_compact_model() or os.environ.get("CAI_MODEL", "gpt-4")}
COMPACTED_SUMMARIES[agent_name] = summary
APPLIED_MEMORY_IDS[agent_name] = memory_id
console.print(f"[green]✓ Memory {memory_id} automatically applied to {agent_name}'s system prompt[/green]")
os.environ['CAI_MEMORY'] = 'true'
# Reload the agent with the new memory
self._reload_agent_with_memory(agent_name)
@ -566,6 +567,7 @@ Model: {get_compact_model() or os.environ.get("CAI_MODEL", "gpt-4")}
console.print(f"[red]Error applying memory to {agent_name}: {e}[/red]")
if success_count > 0:
os.environ['CAI_MEMORY'] = 'true'
console.print("[dim]The memory will be included in the agents' system prompts[/dim]")
# Show summary with ID if available (only once)
@ -906,7 +908,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
@ -1006,7 +1009,7 @@ Model: {get_compact_model() or os.environ.get("CAI_MODEL", "gpt-4")}
self._register_memory(memory_id, memory_name)
console.print(f"[green]✓ Saved memory: {memory_name} (ID: {memory_id})[/green]")
os.environ['CAI_MEMORY'] = 'true'
# Automatically apply the memory to the agent's system prompt
COMPACTED_SUMMARIES[agent_name] = summary
APPLIED_MEMORY_IDS[agent_name] = memory_id

View File

@ -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