Skip to content

refactor(cloud-agent): supply provider startup commands - #7915

Open
eshurakov wants to merge 1 commit into
mainfrom
eshurakov/sleek-magnolia
Open

eshurakov wants to merge 1 commit into
mainfrom
eshurakov/sleek-magnolia

Conversation

@eshurakov

Copy link
Copy Markdown
Contributor

Summary

Move the first sandbox process into a supplied ProviderStartupCommand. Native start and the sleep infinity resume path run that command. Native confirmation accepts that argv or the stable supervisor after exec. The SDK shell-quotes each argument. Vercel runs the argv directly and receives an explicit runtime PATH.

preinstalledStartup() supplies the current supervisor. The Sandbox DO passes one command to the initial and image-fallback launches. This is PR 1 of the approved runtime stack; its base is main. No downloaded mode or release caller exists here.

Verification

No manual provider session ran. No real provider target is authorized. Adapter contract tests execute the captured command locally, including spaces, empty arguments, quotes and shell metacharacters. Native tests cover image start, repository restore, stable supervisor transition and the sleep-PID1 exec path.

Visual Changes

N/A

Reviewer Notes

Automated checks:

  • Worker and wrapper typecheck passed.
  • 488 focused unit tests passed.
  • 465 unique Worker integration tests are covered. One missed fixture override was corrected; its 66-test routes suite passed on rerun.
  • Service lint passed across 709 files. Changed-file formatting and diff checks passed.
  • The wrapper suite had 1218 passes, 19 skips and one fixed-window reconnect failure during dependency setup. That exact test passed on a focused retry after setup ended. Wrapper source is unchanged.

Local matrix rows proved: adapter argv mapping, native entrypoint and sleep-resume ordering, repository restore command selection, billing and containment propagation, wrapper hello/Stop and route lifecycle behavior over fake provider backends.

Still needs an authorized provider: native Cloudflare cold start/preview/billing acceptance, real Vercel login-profile and slow-first-hello parity, and real SDK startup. Local process execution and Worker fakes do not prove hosted provider behavior.

Scope follows Revision 5 sections 3.1 and 4.1. The independent B1 snapshot image fix is #7914.

@kilo-code-bot

kilo-code-bot Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Reviewed the ProviderStartupCommand refactor across the provider adapters, Sandbox Containers DO, and Sandbox Control DO; the changed lines preserve existing preinstalled behavior (argv equals the supervisor) and are consistently threaded through every call site.

Files Reviewed (28 files)
  • services/cloud-agent-next/docs/control-plane.md
  • services/cloud-agent-next/src/control-plane/sandbox/sandbox-do.ts
  • services/cloud-agent-next/src/sandbox-containers/SandboxContainers.ts
  • services/cloud-agent-next/src/sandbox-containers/containers-billing.test.ts
  • services/cloud-agent-next/src/sandbox-containers/main-process.test.ts
  • services/cloud-agent-next/src/sandbox-containers/main-process.ts
  • services/cloud-agent-next/src/sandbox-containers/sandbox-containers.test.ts
  • services/cloud-agent-next/src/sandbox-control/cloudflare-containers-provider.ts
  • services/cloud-agent-next/src/sandbox-control/cloudflare-provider.ts
  • services/cloud-agent-next/src/sandbox-control/container-paths.ts
  • services/cloud-agent-next/src/sandbox-control/preinstalled-startup.ts
  • services/cloud-agent-next/src/sandbox-control/provider-contract.test.ts
  • services/cloud-agent-next/src/sandbox-control/provider-creation.test.ts
  • services/cloud-agent-next/src/sandbox-control/provider.ts
  • services/cloud-agent-next/src/sandbox-control/vercel-provider.ts
  • services/cloud-agent-next/src/sandbox-control/wrapper-launch-env.ts
  • services/cloud-agent-next/test/integration/control-plane-scope-handle.test.ts
  • services/cloud-agent-next/test/integration/control-plane-session-v2-interactions.test.ts
  • services/cloud-agent-next/test/integration/control-plane-session-v2.test.ts
  • services/cloud-agent-next/test/integration/control-plane-status-badge-v2.test.ts
  • services/cloud-agent-next/test/integration/control-plane-terminal-v2.test.ts
  • services/cloud-agent-next/test/integration/control-plane-worktree-changes-v2.test.ts
  • services/cloud-agent-next/test/integration/control-plane-worktree-deletion-v2.test.ts
  • services/cloud-agent-next/test/integration/sandbox-control-v2-credentials.test.ts
  • services/cloud-agent-next/test/integration/sandbox-control-v2-repo-snapshots.test.ts
  • services/cloud-agent-next/test/integration/sandbox-control-v2-routes.test.ts
  • services/cloud-agent-next/test/integration/sandbox-control-v2-runtime-proxy.test.ts
  • services/cloud-agent-next/test/integration/sandbox-control-v2.test.ts

Verified: every changed ProviderAdapter.launch, launchWrapper, startOptions, startWrapper, awaitWrapperExec, observeMainProcess, and readMainProcessIdentity call site passes the new command argument in the correct position, so egressAllowlist/snapshotId are not shifted. The shell-quoted Cloudflare invocation uses the same shellQuote helper already used by workspace.ts, the Vercel PATH injection matches the snapshot install locations in scripts/vercel-snapshot.ts (/usr/local/bin), and removed CONTROL_SUPERVISOR_PATH imports are now unused in the touched files. No memory-leak vector (listeners, timers, unbounded collections) is introduced on the changed lines. Not verifiable locally: real Vercel/Cloudflare-natives hosted behavior, which the PR itself lists as an outstanding authorized-provider gap.


Reviewed by deepseek-v4.1-flash · Input: 111.2K · Output: 24.7K · Cached: 2.2M

Review guidance: REVIEW.md from base branch main

This branch has not been deployed

No deployments
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.

1 participant