Skip to content

refactor: isolate supervisor state per sandbox session #4699

Open

Description

@drew

User Story

I am prototyping gateway-scoped multi-tenant supervision for OpenShell on Kubernetes and need independent supervisor session state so one process can safely host multiple sandboxes.

Problem Statement

The current supervisor starts for one sandbox. Sandbox-specific gateway credentials, telemetry context, and lifecycle assumptions prevent safely composing concurrent sandbox sessions in one process.

Impact / Why This Matters

The experimental supervisor Deployment is idle. Session state must be isolated before it can enforce different policies and credentials for multiple sandboxes.

Proposed Design

Make sandbox identity, gateway credentials and token refresh, policy, providers, middleware, logging context, connection state, and cancellation independent per supervisor session. Preserve existing dedicated-supervisor behavior and the existing Isolation Backend boundary.

Acceptance Criteria

  • Dedicated supervision retains existing behavior.
  • Concurrent sessions cannot share sandbox credentials, policy, or logging identity accidentally.
  • A session can be stopped without cancelling another session or the host process.
  • Existing relevant sandbox E2E behavior succeeds.

Alternatives Considered

One child process per sandbox avoids shared-process state but does not validate the intended in-process multi-tenant supervisor. Middleware and interceptors do not own supervisor lifecycle or gateway authentication state.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions