Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa66e00547 |
@@ -1051,9 +1051,33 @@ Respond with ONLY valid JSON, no markdown fences."""
|
||||
session.messages = self._trim_to_clean_boundary(session.messages, keep_count) if keep_count else []
|
||||
self.sessions.save(session)
|
||||
logger.info(f"Memory consolidation done, session trimmed to {len(session.messages)} messages")
|
||||
self._spawn_ara_research_manager()
|
||||
except Exception as e:
|
||||
logger.error(f"Memory consolidation failed: {e}")
|
||||
|
||||
def _spawn_ara_research_manager(self) -> None:
|
||||
"""Fire-and-forget: update the nanobot ARA trace after memory consolidation.
|
||||
|
||||
Uses the SpawnTool which already has channel/chat_id context from the
|
||||
last message. Silently skips if ARA path doesn't exist or spawn fails.
|
||||
"""
|
||||
import os
|
||||
ara_path = os.path.join(self.workspace, "ara-projects", "nanobot")
|
||||
if not os.path.isdir(ara_path):
|
||||
return
|
||||
spawn_tool = self.tools.get("spawn")
|
||||
if not isinstance(spawn_tool, SpawnTool):
|
||||
return
|
||||
task = (
|
||||
f"Read /root/.nanobot/workspace/skills/ara-research-manager/SKILL.md "
|
||||
f"and run the per-turn procedure on the nanobot ARA at {ara_path}/. "
|
||||
f"Capture any research events from this session."
|
||||
)
|
||||
asyncio.create_task(
|
||||
spawn_tool.execute(task=task, label="ara-pm", model="claude-haiku-4-5")
|
||||
)
|
||||
logger.debug("ARA research-manager task spawned")
|
||||
|
||||
async def process_direct(
|
||||
self,
|
||||
content: str,
|
||||
|
||||
Reference in New Issue
Block a user