deerflow2/backend
DanielWalnut 5f4c58aa82
feat: implement lazy sandbox and thread data initialization (#11)
Defer sandbox acquisition and thread directory creation until first use to improve performance and reduce resource usage.

Changes:
- Add lazy_init parameter to SandboxMiddleware (default: true)
- Add ensure_sandbox_initialized() helper for lazy sandbox acquisition
- Update all sandbox tools to use lazy initialization
- Add lazy_init parameter to ThreadDataMiddleware (default: true)
- Create thread directories on-demand in AioSandboxProvider
- LocalSandbox already creates directories on write (no changes needed)

Benefits:
- Saves 1-2s Docker container startup for conversations without tools
- Reduces unnecessary directory creation and file system operations
- Backward compatible with lazy_init=false option

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-18 13:38:34 +08:00
..
.claude feat: add AIO sandbox provider and auto title generation (#1) 2026-01-14 23:29:18 +08:00
.vscode chore: specify project title 2026-01-14 09:57:52 +08:00
docs feat: fix todos (#9) 2026-01-17 23:23:12 +08:00
src feat: implement lazy sandbox and thread data initialization (#11) 2026-01-18 13:38:34 +08:00
tests feat: add AIO sandbox provider and auto title generation (#1) 2026-01-14 23:29:18 +08:00
.gitignore chore: use ruff to lint and auto-format 2026-01-14 09:08:20 +08:00
.python-version chore: add Python and LangGraph stuff 2026-01-14 07:15:02 +08:00
AGENTS.md feat: add AIO sandbox provider and auto title generation (#1) 2026-01-14 23:29:18 +08:00
CLAUDE.md feat: add skills system for specialized agent workflows (#6) 2026-01-16 14:44:51 +08:00
Makefile fix: fix backend python execution (#10) 2026-01-18 12:41:48 +08:00
debug.py feat: support function factory (#4) 2026-01-15 22:05:54 +08:00
langgraph.json feat: support function factory (#4) 2026-01-15 22:05:54 +08:00
pyproject.toml feat: add gateway module with FastAPI server (#5) 2026-01-16 13:22:26 +08:00
ruff.toml chore: use ruff to lint and auto-format 2026-01-14 09:08:20 +08:00
uv.lock feat: add gateway module with FastAPI server (#5) 2026-01-16 13:22:26 +08:00