feat: fix todos (#9)

This commit is contained in:
DanielWalnut
2026-01-17 23:23:12 +08:00
committed by GitHub
parent 3f1f6af30c
commit aa030410fc
10 changed files with 234 additions and 141 deletions

View File

@@ -16,7 +16,14 @@ class SandboxMiddlewareState(AgentState):
class SandboxMiddleware(AgentMiddleware[SandboxMiddlewareState]):
"""Create a sandbox environment and assign it to an agent."""
"""Create a sandbox environment and assign it to an agent.
Lifecycle Management:
- Sandbox is acquired on first agent invocation for a thread (before_agent)
- Sandbox is reused across multiple turns within the same thread
- Sandbox is NOT released after each agent call to avoid wasteful recreation
- Cleanup happens at application shutdown via SandboxProvider.shutdown()
"""
state_schema = SandboxMiddlewareState