refactor(agent): unify session message admission

This commit is contained in:
chengyongru authored and chengyongru committed 2026-09-17 22:18:38 +08:00
1 parent 7208fb663f
commit b669c2036c
17 files changed
+284 -257

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
"""Session-worker completion helpers for integration tests."""
import asyncio
from nanobot.agent.loop import AgentLoop
from nanobot.bus.events import InboundMessage
async def run_session(loop: AgentLoop, msg: InboundMessage) -> None:
"""Submit input and wait for its session worker to finish."""
loop._enqueue_session_message(msg)
await asyncio.gather(*loop._active_tasks[loop._effective_session_key(msg)])