From 61e3513c66f3f266916c4012935a7a252135d260 Mon Sep 17 00:00:00 2001 From: Willem Jiang Date: Tue, 20 Oct 2026 19:25:54 +0800 Subject: [PATCH] docs: scope E2B upload guidance to fix CI budgets (#7181) --- backend/packages/harness/deerflow/AGENTS.md | 31 ++---------------- .../deerflow/community/e2b_sandbox/AGENTS.md | 32 +++++++++++++++++++ 2 files changed, 34 insertions(+), 29 deletions(-) diff --git a/backend/packages/harness/deerflow/AGENTS.md b/backend/packages/harness/deerflow/AGENTS.md index 56968beebc..d9b56dcd6d 100644 --- a/backend/packages/harness/deerflow/AGENTS.md +++ b/backend/packages/harness/deerflow/AGENTS.md @@ -123,35 +123,8 @@ Env values stay strings; parse booleans before SDK calls (`bool("false")` is tru ### E2B Mount Uploads -E2B uploads host mounts during sandbox creation using binary file objects. -Per-mount limits: 100 MiB/file, 512 MiB total, 2,000 files. The full creation -pass shares a 512 MiB / 2,000-file budget across skill projections and mounts. - -The pass has a cooperative deadline controlled by -``mount_upload_deadline_seconds`` (default: 120 seconds). The provider checks it before -each mount, during directory preflight, and before each SDK write. The deadline -does not interrupt active filesystem or E2B SDK calls. - -The provider checks mount limits before upload. It rechecks each opened file descriptor against its preflight size before SDK upload. - -For policy-scoped turns, clearing the four managed remote skill categories and -uploading their prepared projection is one per-user/thread/skills-root critical -section, shared with acquire and release. The provider snapshots that canonical -root at startup and carries it through warm-pool identity and E2B metadata; a VM -from another root is never adopted. A second policy sync cannot reset the remote -tree until the first upload pass has completed. - -An invalid mount does not block later mounts. - -Each successful upload logs its source, destination, file count, byte count, and elapsed time. - -A stopped pass logs its limit reason and elapsed time. It reports attempted and completed upload totals separately. - -After creation, ``E2BSandbox.mount_upload_result`` holds a ``MountUploadResult``. -``result.truncated`` is true only for resource-limit stops (deadline, file count, -bytes), not logged mount failures (missing paths, SDK errors). A provider-level -map preserves creation results within the Gateway process; ``None`` on a -reclaimed sandbox means unavailable. +Before changing creation uploads, policy projections, budgets, deadlines, or result +reporting, read [the E2B upload contract](community/e2b_sandbox/AGENTS.md#mount-uploads). ### Workspace Snapshot Cancellation (`workspace_changes/recorder.py`) diff --git a/backend/packages/harness/deerflow/community/e2b_sandbox/AGENTS.md b/backend/packages/harness/deerflow/community/e2b_sandbox/AGENTS.md index 8a69a2ccf5..80dd012422 100644 --- a/backend/packages/harness/deerflow/community/e2b_sandbox/AGENTS.md +++ b/backend/packages/harness/deerflow/community/e2b_sandbox/AGENTS.md @@ -75,3 +75,35 @@ Split `grep` and `glob` output records only on `"\n"`, matching can occur inside filenames or matched text. The real-shell tests cover these characters in filenames, parent directories, and grep content; their transport decodes captured bytes without universal-newline conversion. + +## Mount uploads + +E2B uploads host mounts during sandbox creation using binary file objects. +Per-mount limits: 100 MiB/file, 512 MiB total, 2,000 files. The full creation +pass shares a 512 MiB / 2,000-file budget across skill projections and mounts. + +The pass has a cooperative deadline controlled by +``mount_upload_deadline_seconds`` (default: 120 seconds). The provider checks it before +each mount, during directory preflight, and before each SDK write. The deadline +does not interrupt active filesystem or E2B SDK calls. + +The provider checks mount limits before upload. It rechecks each opened file descriptor against its preflight size before SDK upload. + +For policy-scoped turns, clearing the four managed remote skill categories and +uploading their prepared projection is one per-user/thread/skills-root critical +section, shared with acquire and release. The provider snapshots that canonical +root at startup and carries it through warm-pool identity and E2B metadata; a VM +from another root is never adopted. A second policy sync cannot reset the remote +tree until the first upload pass has completed. + +An invalid mount does not block later mounts. + +Each successful upload logs its source, destination, file count, byte count, and elapsed time. + +A stopped pass logs its limit reason and elapsed time. It reports attempted and completed upload totals separately. + +After creation, ``E2BSandbox.mount_upload_result`` holds a ``MountUploadResult``. +``result.truncated`` is true only for resource-limit stops (deadline, file count, +bytes), not logged mount failures (missing paths, SDK errors). A provider-level +map preserves creation results within the Gateway process; ``None`` on a +reclaimed sandbox means unavailable.