From caf36c7095c86e97731d83191f26db037bdefc9d Mon Sep 17 00:00:00 2001 From: Babis Chalios Date: Wed, 9 Sep 2026 16:30:29 +0200 Subject: [PATCH] docs(sdk): onResume needs a control plane that knows the option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The docstrings promised the API rejects memory:false wherever the flag is off. On a control plane that predates the field — a self-hosted or lagging BYOC deployment — the JSON decoder drops the unknown field and the sandbox resumes memory-restored with a normal 2xx, the exact silent downgrade the option exists to avoid. State the requirement and the failure shape in the JSDoc and all six Python docstrings, in the deployment-caveat shape the egressProxy option already uses. Signed-off-by: Babis Chalios --- .changeset/on-resume-control-plane-caveat.md | 6 ++++++ packages/js-sdk/src/sandbox/sandboxApi.ts | 6 ++++++ packages/python-sdk/e2b/sandbox_async/main.py | 12 ++++++++++++ packages/python-sdk/e2b/sandbox_sync/main.py | 12 ++++++++++++ 4 files changed, 36 insertions(+) create mode 100644 .changeset/on-resume-control-plane-caveat.md diff --git a/.changeset/on-resume-control-plane-caveat.md b/.changeset/on-resume-control-plane-caveat.md new file mode 100644 index 0000000000..19c4b68e1d --- /dev/null +++ b/.changeset/on-resume-control-plane-caveat.md @@ -0,0 +1,6 @@ +--- +"e2b": patch +"@e2b/python-sdk": patch +--- + +Document that `onResume` / `on_resume` needs a control plane that knows the option: an older self-hosted or BYOC control plane drops the `memory` field and restores memory while reporting success, instead of rejecting the request. diff --git a/packages/js-sdk/src/sandbox/sandboxApi.ts b/packages/js-sdk/src/sandbox/sandboxApi.ts index 0b6f215a5a..2e5307f150 100644 --- a/packages/js-sdk/src/sandbox/sandboxApi.ts +++ b/packages/js-sdk/src/sandbox/sandboxApi.ts @@ -710,6 +710,12 @@ export type SandboxConnectOpts = ConnectionOpts & { * is not enabled; a no-op for a snapshot without memory or a sandbox that is * already running. * + * Needs a control plane that knows this option: E2B Cloud, or a self-hosted + * or BYOC deployment built from `e2b-dev/infra` at or after the commit that + * added the `memory` field to connect/resume (2026-08-20). An older control + * plane drops the field and restores memory while answering as if the + * request had succeeded. + * * @default 'restore' * @throws {@link InvalidArgumentError} if the value is outside the two literals. */ diff --git a/packages/python-sdk/e2b/sandbox_async/main.py b/packages/python-sdk/e2b/sandbox_async/main.py index e3912b2700..35ed4c1e97 100644 --- a/packages/python-sdk/e2b/sandbox_async/main.py +++ b/packages/python-sdk/e2b/sandbox_async/main.py @@ -284,6 +284,10 @@ async def connect( Rejected where filesystem-only resume is not enabled; a no-op for a snapshot without memory or a sandbox that is already running. A value outside the two literals raises `InvalidArgumentException`. + Needs a control plane that knows this option: E2B Cloud, or a self-hosted or BYOC + deployment built from `e2b-dev/infra` at or after the commit that added the `memory` + field to connect/resume (2026-08-20). An older control plane drops the field and + restores memory while answering as if the request had succeeded. :return: A running sandbox instance @example @@ -322,6 +326,10 @@ async def connect( Rejected where filesystem-only resume is not enabled; a no-op for a snapshot without memory or a sandbox that is already running. A value outside the two literals raises `InvalidArgumentException`. + Needs a control plane that knows this option: E2B Cloud, or a self-hosted or BYOC + deployment built from `e2b-dev/infra` at or after the commit that added the `memory` + field to connect/resume (2026-08-20). An older control plane drops the field and + restores memory while answering as if the request had succeeded. :return: A running sandbox instance @example @@ -356,6 +364,10 @@ async def connect( Rejected where filesystem-only resume is not enabled; a no-op for a snapshot without memory or a sandbox that is already running. A value outside the two literals raises `InvalidArgumentException`. + Needs a control plane that knows this option: E2B Cloud, or a self-hosted or BYOC + deployment built from `e2b-dev/infra` at or after the commit that added the `memory` + field to connect/resume (2026-08-20). An older control plane drops the field and + restores memory while answering as if the request had succeeded. :return: A running sandbox instance @example diff --git a/packages/python-sdk/e2b/sandbox_sync/main.py b/packages/python-sdk/e2b/sandbox_sync/main.py index 976d7c357b..d252c54f31 100644 --- a/packages/python-sdk/e2b/sandbox_sync/main.py +++ b/packages/python-sdk/e2b/sandbox_sync/main.py @@ -278,6 +278,10 @@ def connect( Rejected where filesystem-only resume is not enabled; a no-op for a snapshot without memory or a sandbox that is already running. A value outside the two literals raises `InvalidArgumentException`. + Needs a control plane that knows this option: E2B Cloud, or a self-hosted or BYOC + deployment built from `e2b-dev/infra` at or after the commit that added the `memory` + field to connect/resume (2026-08-20). An older control plane drops the field and + restores memory while answering as if the request had succeeded. :return: A running sandbox instance @example @@ -317,6 +321,10 @@ def connect( Rejected where filesystem-only resume is not enabled; a no-op for a snapshot without memory or a sandbox that is already running. A value outside the two literals raises `InvalidArgumentException`. + Needs a control plane that knows this option: E2B Cloud, or a self-hosted or BYOC + deployment built from `e2b-dev/infra` at or after the commit that added the `memory` + field to connect/resume (2026-08-20). An older control plane drops the field and + restores memory while answering as if the request had succeeded. :return: A running sandbox instance @example @@ -351,6 +359,10 @@ def connect( Rejected where filesystem-only resume is not enabled; a no-op for a snapshot without memory or a sandbox that is already running. A value outside the two literals raises `InvalidArgumentException`. + Needs a control plane that knows this option: E2B Cloud, or a self-hosted or BYOC + deployment built from `e2b-dev/infra` at or after the commit that added the `memory` + field to connect/resume (2026-08-20). An older control plane drops the field and + restores memory while answering as if the request had succeeded. :return: A running sandbox instance @example