Compare commits

..
Author SHA1 Message Date
nanobot fa66e00547 feat: wire ara-research-manager into memory consolidation
Build Nanobot OAuth / cleanup (pull_request) Has been skipped
Build Nanobot OAuth / build (pull_request) Successful in 6m12s
After _consolidate_memory completes (on /new or auto-compact), spawn
a background ara-pm subagent that runs the ara-research-manager skill
on /workspace/ara-projects/nanobot/. Fire-and-forget via asyncio.create_task.
Silently skips if ara-projects/nanobot/ doesn't exist.
2026-05-05 23:07:39 +02:00
+24
View File
@@ -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,