Skip to content

feat: add non-provisioning sandbox stop lifecycle - #3295

Open
codyss wants to merge 1 commit into
vercel:mainfrom
codyss:codex/stop-sandbox-lifecycle
Open

codyss wants to merge 1 commit into
vercel:mainfrom
codyss:codex/stop-sandbox-lifecycle

Conversation

@codyss

@codyss codyss commented Sep 11, 2026

Copy link
Copy Markdown

Summary

Add a non-provisioning SessionContext.stopSandbox() lifecycle API for durable session boundaries.

The API stops the current session's owned compute without calling getSandbox(), creating a provider resource, resuming a stopped resource, running onSession, or running base-runtime initialization. Persisted session metadata remains available for the next callback.

Implementation

  • Add SessionContext.stopSandbox() with idempotent and ownership-aware behavior.
  • Add the optional backend stopExisting primitive and public input/result types.
  • Coalesce concurrent stop requests within one access and tolerate replayed requests.
  • Add the Vercel implementation using Sandbox.get({ resume: false }) and stop only running or pending resources.
  • Preserve the existing explicit live-handle getSandbox().stop() behavior.
  • Document the lifecycle API and add unit and integration coverage for unused, persisted, concurrent, shared, missing, already-stopped, and provider-failure cases.

Verification

  • pnpm exec oxfmt --check .
  • pnpm --filter eve typecheck
  • pnpm --filter eve build:js
  • pnpm --filter eve exec vitest run --config vitest.unit.config.ts src/execution/sandbox/ensure.test.ts src/execution/sandbox/bindings/vercel.test.ts
  • pnpm --filter eve exec vitest run --config vitest.integration.config.ts src/context/accessors.integration.test.ts

The full unit suite currently has four environment-sensitive failures unrelated to this change: three existing redaction assertions include the checkout's /private path, and one existing production-server test cannot bind loopback in the restricted test environment. The focused lifecycle and Vercel suites pass.

@vercel

vercel Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

@codyss is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

Signed-off-by: cody <cody@bobsled.co>
@codyss
codyss force-pushed the codex/stop-sandbox-lifecycle branch from c161b44 to 9e16af5 Compare September 11, 2026 19:49
@codyss
codyss marked this pull request as ready for review September 11, 2026 19:49
@codyss

codyss commented Sep 11, 2026

Copy link
Copy Markdown
Author

Ready for review after adding the DCO sign-off.

This API is needed by Dogsled to stop Vercel Sandbox compute at durable session boundaries without provisioning or resuming a resource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants