feat: add thread data middleware (#2)

This commit is contained in:
DanielWalnut
2026-01-15 13:22:30 +08:00
committed by GitHub
parent ab427731dc
commit c92eedc572
8 changed files with 181 additions and 14 deletions

View File

@@ -1,12 +1,11 @@
from src.sandbox.local.local_sandbox import LocalSandbox
from src.sandbox.sandbox import Sandbox
from src.sandbox.sandbox_provider import SandboxProvider
_singleton: LocalSandbox | None = None
class LocalSandboxProvider(SandboxProvider):
def acquire(self) -> Sandbox:
def acquire(self, thread_id: str | None = None) -> str:
global _singleton
if _singleton is None:
_singleton = LocalSandbox("local")