Skip to content

Add CreateOS Sandbox provider - #9

Open
pratikbin wants to merge 6 commits into
opencoredev:mainfrom
NodeOps-app:main
Open

Add CreateOS Sandbox provider#9
pratikbin wants to merge 6 commits into
opencoredev:mainfrom
NodeOps-app:main

Conversation

@pratikbin

@pratikbin pratikbin commented Jul 27, 2026

Copy link
Copy Markdown

Why

Adds CreateOS Sandbox as a provider: createos() runs sandboxes on NodeOps' VM-based CreateOS platform via the official @nodeops-createos/sandbox SDK, giving agent workloads normalized files/commands/lifecycle/preview access through the same Sandbox SDK surface as the existing providers.

CreateOS currently ranks #2 of 21 providers on the independent ComputeSDK Sandbox Benchmark — Sequential TTI, composite score 99.5 — and #2 on the Dax benchmark (7/7 phases completed, 47.92s median total duration).

What changed

  • add createos provider adapter (packages/sdk/src/providers/createos/index.ts), package export (@opencoredev/sandbox-sdk/createos), capability metadata, example, and unit + live test coverage
  • map CreateosSandbox* error classes (auth, permission, not-found, timeout, rate-limit, validation, server, connection) onto normalized SandboxError codes, with timeout/rate-limit/server/connection marked retryable
  • files.list/mkdir/remove/exists implemented over shell (ls -1apL, mkdir -p, rm -rf, test -e) since the underlying SDK only exposes upload/download
  • run()/start() wrap commands in bash -c, injecting per-call cwd/env via shell export/cd prefixing; start() bridges the SDK's async-iterator stream into the SDK's process/output contract
  • expose() lazily enables ingress on first call and returns the provider's preview URL
  • snapshots are unsupported (unsupportedSnapshots("createos")); pause/resume/fork are reachable via sandbox.raw
  • register createos in providerNames, metadata.ts, capabilities.ts, tsdown.config.ts, and package.json exports/dependencies (@nodeops-createos/sandbox as an optional peer, pinned ^0.7.1)

Testing

  • bun install
  • bun run lint — 0 warnings/errors
  • bun run typecheck
  • bun run build
  • bun run test — 49 pass, 0 fail (includes 5 new createos unit tests mocking the SDK client); 26 skipped, including 9 createos live tests gated on CREATEOS_SANDBOX_API_KEY/CREATEOS_SANDBOX_BASE_URL
  • npm pack --dry-run in packages/sdk

Notes

  • Live validation (real CreateOS sandbox create/run/files/ports/pause-resume/fork) requires CREATEOS_SANDBOX_API_KEY + CREATEOS_SANDBOX_BASE_URL and was not run in this environment; the live suite skips cleanly without them.
  • stdin is not available on exec, matching the underlying platform's runCommand API — process.write() throws unsupported.

@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

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

A member of the Team first needs to authorize it.

@greptile-apps

greptile-apps Bot commented Jul 27, 2026

Copy link
Copy Markdown

Greptile Summary

Adds CreateOS as a supported sandbox provider.

  • Implements normalized file, command, process, lifecycle, port, capability, metadata, and error-mapping behavior.
  • Registers the provider’s package export, optional peer dependency, build entry point, example, and provider metadata.
  • Adds mocked unit tests and credential-gated live coverage for CreateOS operations.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failures remain within the scope of the reviewed changes.

T-Rex T-Rex Logs

What T-Rex did

  • Validated the file-list normalization behavior by comparing results before and after adapter capture, noting a failure prior to capture and all tests passing after capture.
  • Validated the module export path resolution by comparing results before and after export capture, noting Node reported ERR_PACKAGE_PATH_NOT_EXPORTED before capture and a successful import resolving to provider id createos with the expected unsupported capabilities after capture.
  • Concluded that no executed behavior contradicted the PR.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
packages/sdk/src/providers/createos/index.ts Implements the CreateOS adapter and addresses the previously reported environment, listing, and process-cancellation behaviors.
packages/sdk/src/providers/capabilities.ts Declares the normalized capabilities exposed by the CreateOS provider.
packages/sdk/src/metadata.ts Registers CreateOS provider metadata, configuration variables, and runtime limitations.
packages/sdk/package.json Adds the CreateOS export, live-test command, and optional peer dependency.
packages/sdk/tests/providers/createos.test.ts Adds mocked coverage for core CreateOS adapter operations and capabilities.
packages/sdk/tests/live/createos.test.ts Adds credential-gated integration coverage for CreateOS files, processes, ports, and lifecycle operations.

Reviews (6): Last reviewed commit: "Classify symlinks correctly in files.lis..." | Re-trigger Greptile

Comment thread packages/sdk/src/providers/createos/index.ts
Comment thread packages/sdk/src/providers/createos/index.ts Outdated
Comment thread packages/sdk/src/providers/createos/index.ts Outdated
pratikbin and others added 2 commits July 27, 2026 17:47
…igin preview fix)

# Conflicts:
#	packages/sdk/package.json
#	packages/sdk/src/core/types.ts
#	packages/sdk/src/metadata.ts
#	packages/sdk/src/providers/capabilities.ts
#	packages/sdk/tsdown.config.ts
…ping

- Use AbortController to cancel remote streamCommand on kill()
- Replace ls -1apL with find -printf using null-byte delimiters to handle
  filenames with newlines and avoid symlink dereferencing
- Quote env keys with shellQuote() in export statements to prevent
  shell injection via metacharacters in both run() and start()
Comment thread packages/sdk/src/providers/createos/index.ts
Comment thread packages/sdk/src/providers/createos/index.ts Outdated
- Catch abort errors in stream iterator so wait() resolves with exit
  code 137 instead of rejecting when kill() is called
- Replace export with env command prefix to support non-identifier
  env keys like MY-KEY in both run() and start()
Comment thread packages/sdk/src/providers/createos/index.ts
Comment thread packages/sdk/src/providers/createos/index.ts Outdated
- Check combinedSignal.aborted instead of only killController so
  caller-provided signal aborts also resolve wait() gracefully
- Make kill() await the completed promise so it only returns after
  the remote stream has actually terminated
Comment thread packages/sdk/src/providers/createos/index.ts
Map find type char 'l' to 'symlink' instead of falling through to 'file'.
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