Vanzeren
67c8ade375
feat(sandbox): warm pool for boxlite (#3951)
* feat: add boxlite SDK as harness dependency
* test: add fake SimpleBox fixtures for BoxLite warm pool tests
* feat: add deterministic sandbox_id and warm pool fields to BoxliteProvider
* feat: pass deterministic sandbox_id to SimpleBox name
* feat: warm pool lifecycle — park on release, reclaim on acquire
- release(): parks VMs in _warm_pool with timestamp instead of closing
- _reclaim_warm_pool(): health checks warm boxes via echo ok
- acquire(): tries warm pool reclaim before creating new boxes
- Deterministic sandbox_id ensures thread isolation
* feat(boxlite): idle reaper, replica enforcement, warm-pool shutdown/reset
- Task 6: idle reaper daemon thread destroys expired warm-pool boxes
- Task 7: replica enforcement evicts oldest warm-pool box when at capacity
- Task 8: shutdown() stops idle checker first, destroys all boxes (active+warm);
reset() clears warm pool
Tests: 17 passed (4 new: idle reaper, replica enforcement, shutdown, reset)
* fix(boxlite): harden warm pool lifecycle races
* docs(boxlite): document warm pool configuration
* fix(sandbox): log warning when evicting oldest warm box is failed
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* fix(boxlite): stop provider lifecycle on reset
* fix(boxlite): make runtime an optional dependency
* test(boxlite): remove unused warm pool lookup
* docs(boxlite): clarify optional runtime support
* refactor: extract shared WarmPoolLifecycleMixin for sandbox warm-pool lifecycle
Introduce deerflow.community.warm_pool_lifecycle.WarmPoolLifecycleMixin
owning idle-checker loop, warm-pool expiry, oldest-warm eviction,
replica counting, and soft-cap logging. Move AioSandboxProvider and
BoxliteProvider onto the mixin; keep AIO active-idle cleanup local and
delegate only warm-pool expiry to the shared helper.
BoxliteProvider also gains:
- Prefixed box names (deer-flow-boxlite-*) for startup orphan reconciliation
- _reconcile_orphans() adopting surviving boxes from a prior process
- Pinned timeout forwarding: command timeout now bounds both BoxLite
SDK exec(timeout=...) and the loop bridge .result(timeout)
- reset() reworked as lightweight registry clear (boxes -> warm pool,
no close, no idle-reaper stop, no loop close) so reset_sandbox_provider()
config switches are safe; shutdown() remains the teardown path
Backward-compatible: AIO DEFAULT_IDLE_TIMEOUT/DEFAULT_REPLICAS/
IDLE_CHECK_INTERVAL stay importable; Boxlite IDLE_CHECK_INTERVAL
stays monkeypatchable.
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-06 07:21:12 +08:00
..
2026-07-02 11:38:21 +08:00
2026-03-26 00:14:08 +08:00
2026-06-16 23:20:20 +08:00
2026-06-21 15:47:53 +08:00
2026-06-02 10:03:28 +08:00
2026-05-29 11:36:45 +08:00
2026-06-02 10:03:28 +08:00
2026-06-30 18:58:02 +08:00
2026-06-12 10:20:38 +08:00
2026-07-06 07:21:12 +08:00
2026-05-01 20:19:30 +08:00
2026-06-21 16:08:25 +08:00
2026-06-18 10:45:33 +08:00
2026-07-03 15:39:12 +08:00
2026-03-14 22:55:52 +08:00
2026-06-10 23:26:15 +08:00
2026-03-29 23:53:23 +08:00
2026-03-29 23:53:23 +08:00
2026-05-21 14:36:07 +08:00
2026-03-14 22:55:52 +08:00
2026-06-09 11:56:28 +08:00
2026-06-03 22:02:27 +08:00
2026-06-09 21:58:31 +08:00
2026-03-29 15:31:18 +08:00
2026-03-25 16:28:33 +08:00
2026-04-03 16:03:06 +08:00
2026-06-03 22:02:27 +08:00
2026-05-01 22:19:50 +08:00
2026-06-21 15:47:53 +08:00
2026-07-04 16:07:42 +08:00
2026-07-04 11:27:19 +08:00
2026-03-14 22:55:52 +08:00
2026-07-02 00:13:01 +08:00
2026-05-29 11:36:45 +08:00
2026-07-03 08:49:33 +08:00