mirror of
https://github.com/usestrix/strix.git
synced 2026-08-18 09:49:17 +02:00
- Replace multiprocessing/threading with single asyncio task per agent - Add task cancellation: new request cancels previous for same agent - Add per-agent state isolation via ContextVar for Terminal, Browser, Python managers - Add posthog telemetry for tool execution errors (timeout, http, sandbox) - Fix proxy manager singleton pattern - Increase client timeout buffer over server timeout - Add context.py to Dockerfile
13 lines
280 B
Python
13 lines
280 B
Python
from contextvars import ContextVar
|
|
|
|
|
|
current_agent_id: ContextVar[str] = ContextVar("current_agent_id", default="default")
|
|
|
|
|
|
def get_current_agent_id() -> str:
|
|
return current_agent_id.get()
|
|
|
|
|
|
def set_current_agent_id(agent_id: str) -> None:
|
|
current_agent_id.set(agent_id)
|