Align the L3 graph, agent service, and sync tool shims on one canonical continuity contract so clarification resumes and persisted snapshots behave consistently. Add targeted regressions and hardening notes covering system-message coalescing, async bridge usage, and continuity rehydration.
19 lines
417 B
Python
19 lines
417 B
Python
from __future__ import annotations
|
|
|
|
import asyncio
|
|
from concurrent.futures import ThreadPoolExecutor
|
|
from typing import Any
|
|
|
|
_executor = ThreadPoolExecutor(max_workers=4)
|
|
|
|
|
|
def run_async(coro: Any, timeout: int = 30):
|
|
try:
|
|
asyncio.get_running_loop()
|
|
except RuntimeError:
|
|
return asyncio.run(coro)
|
|
return _executor.submit(asyncio.run, coro).result(timeout=timeout)
|
|
|
|
|
|
__all__ = ["run_async"]
|