Skip to content

feat(sandbox): add canonical main process - #2726

Open
drew wants to merge 7 commits into
mainfrom
codex/2710-canonical-main-process
Open

feat(sandbox): add canonical main process#2726
drew wants to merge 7 commits into
mainfrom
codex/2710-canonical-main-process

Conversation

@drew

@drew drew commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add one canonical main process to every sandbox and make it the process observed by sandbox connect. The supervisor retains and multiplexes its session across reconnects, while sandbox exec remains an independent process path. Any unexpected canonical-process exit, including exit code 0, is persisted on the sandbox and transitions it to Error; intentional stop/start teardown is exempt.

Related Issue

Closes #2710

Changes

  • Add command and tty directly to the public and compute-driver sandbox specs, with sandbox-owned main instance and exit status.
  • Normalize omitted and pre-upgrade persisted driver specs to the default /bin/bash -l TTY main process.
  • Launch the canonical process in Docker, Podman, Kubernetes, and VM runtimes with exact argv transport and native runtime restart disabled.
  • Add a supervisor-owned PTY/pipe session multiplexer with bounded replay, live fanout, one stdin owner, read-only readers, resize, signals, and disconnect-safe process ownership.
  • Route sandbox connect through the retained main session while preserving independent exec, SFTP, editor, and forwarding behavior.
  • Make trailing sandbox create argv the persisted main process, attach interactively by default, and add --detach.
  • Record unexpected main-process exits as terminal sandbox errors and preserve intentional stop/start lifecycle transitions.
  • Update SDKs, architecture and published docs, driver references, CLI agent guidance, and E2E coverage.

Testing

  • mise run pre-commit
  • mise run test with an isolated system-gateway directory
  • Focused core, server, supervisor, VM driver, SDK, and CLI lifecycle tests
  • Docker sandbox lifecycle E2E, including competing attachments, disconnect/reconnect, same PID, PTY history replay, exit status, and --no-keep
  • Pre-upgrade VM driver-spec compatibility regression coverage

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • User-facing and architecture documentation updated
  • Related agent skill updated

@copy-pr-bot

copy-pr-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions

Copy link
Copy Markdown

@drew

This comment was marked as resolved.

@drew
drew force-pushed the codex/2710-canonical-main-process branch from f192d21 to 05983c0 Compare August 13, 2026 19:58
@drew

This comment was marked as resolved.

@drew
drew force-pushed the codex/2710-canonical-main-process branch 3 times, most recently from 5040f5c to 3416111 Compare August 18, 2026 23:44
drew added 3 commits August 18, 2026 17:18
Closes #2710

Persist and supervise one canonical workload per sandbox, attach sandbox connect to its retained session, and make every unexpected main-process exit terminal.

Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
@drew
drew force-pushed the codex/2710-canonical-main-process branch from 3416111 to d52f50e Compare August 19, 2026 00:28
@drew
drew marked this pull request as ready for review August 19, 2026 00:30
@drew
drew requested review from a team, derekwaynecarr, mrunalp and sjenning as code owners August 19, 2026 00:30
drew added 4 commits August 18, 2026 17:50
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
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.

feat: define a canonical sandbox main process and reconnectable session

1 participant