Skip to content

feat(runtime): support Windows OpenSandbox guests - #148

Draft
zpzjzj wants to merge 6 commits into
mainfrom
feat/opensandbox-windows-guest
Draft

feat(runtime): support Windows OpenSandbox guests#148
zpzjzj wants to merge 6 commits into
mainfrom
feat/opensandbox-windows-guest

Conversation

@zpzjzj

@zpzjzj zpzjzj commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add typed OpenSandbox platform and optional resources configuration with Windows guest defaults and user overrides
  • route workspace setup, transfers, Custom Engine execution, PowerShell script judging, and artifact collection through guest-OS path and shell semantics
  • replace the lifecycle compatibility implementation with the official Go SDK create path
  • add bilingual documentation plus an opt-in Extended CI job that runs a deterministic real Windows guest lifecycle

Compatibility

Omitting environment.platform and environment.resources preserves the existing Linux behavior. Built-in Agent CLI bootstrap inside Windows guests remains out of scope (tracked by #48); preinstalled CLIs and Custom Engines are supported.

Validation

  • make verify
  • go test -race ./internal/config ./internal/agent ./internal/judge ./internal/evaluator
  • go test -race ./internal/runtime -skip TestNoneRuntime_ExecTerminatesGracefullyThenEscalates
  • go test -tags e2e ./e2e -run "TestCustomEngine_OpenSandboxWindowsGuest|TestPipeline_CustomEngine_LocalTransport" -count=1
  • Windows fixture validation runs without infrastructure; the real guest run is gated by the Extended CI windows_guest workflow input and requires KVM/TUN/Docker

make test also exercised the full suite, but the existing 300 ms SIGTERM timing test TestNoneRuntime_ExecTerminatesGracefullyThenEscalates intermittently missed its trap under the race run. A subsequent runtime race run excluding only that known flaky passed. The local full quick E2E run additionally hit a broken machine-local Codex install (spawn .../codex ENOENT); the targeted Custom Engine E2E passed.

Closes #45

@zpzjzj
zpzjzj requested a review from hittyt as a code owner July 17, 2026 03:08
@zpzjzj

zpzjzj commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator Author

Extended CI follow-up: https://github.com/alibaba/skill-up/actions/runs/29551950851

  • Linux OpenSandbox E2E passed after isolating the Windows server on port 8081.
  • none-runtime full E2E, Windows-host quick E2E, Docker E2E/full-LLM, and GoReleaser checks passed.
  • The real OpenSandbox Windows guest lifecycle was not executed: the selected runner reported /dev/kvm as unavailable or not readable/writable, so the gated steps were skipped. A KVM-capable runner is still required for end-to-end Windows guest validation.

@zpzjzj
zpzjzj requested a review from roark47 July 20, 2026 01:24
@zpzjzj
zpzjzj marked this pull request as draft July 20, 2026 01:52
@roark47

roark47 commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

@copilot resolve the merge conflicts in this pull request

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ zpzjzj
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown

@copilot resolve the merge conflicts in this pull request

Resolved in commit fix(ci): resolve merge conflict in extended-ci.yml with main. The only conflicting file was .github/workflows/extended-ci.yml — the e2e and e2e-opensandbox jobs added in this branch were removed (they were moved to model-e2e.yml in main), while the windows_guest dispatch input and e2e-opensandbox-windows job are retained.

@roark47 roark47 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comprehensive implementation. I checked the current head locally: make verify and the full make test race suite both pass.

I don't think this is ready to merge yet:

  • The real OpenSandbox Windows guest lifecycle has not completed successfully. The documented Extended CI run skipped it because the selected runner lacked usable KVM. Since Windows guest support is the core behavior of this PR, please obtain at least one successful end-to-end run on a trusted KVM/TUN-capable runner.
  • Please address the self-hosted runner scoping and mutable Windows image findings below.
  • Please harden the cmd.exe path fallback quoting described below.
  • Resource values are currently validated only for non-blank text. Please either validate the accepted CPU/memory/disk syntax (and document that quotas are enforced server-side), or explicitly justify delegating all validation to OpenSandbox.
  • Before merging, the PR also needs to leave Draft state, be updated with main, obtain review approval, and clear the currently pending CLA check caused by the Copilot conflict-resolution commits.

The overall architecture—guest-specific path handling, traversal checks, SDK create path, and cross-component Windows adaptations—looks solid; the request for changes is about closing the security and validation gaps before merging.

e2e-opensandbox-windows:
name: E2E (OpenSandbox Windows guest)
if: github.event_name == 'workflow_dispatch' && inputs.windows_guest
runs-on: self-hosted

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Please scope this to a dedicated trusted KVM-capable runner instead of the generic self-hosted pool. This job checks out and executes the selected ref, installs packages, starts Docker with host networking, and accesses /dev/kvm and /dev/net/tun; scheduling it on any self-hosted runner unnecessarily broadens the blast radius. Labels such as [self-hosted, linux, x64, docker, trusted, kvm] would also prevent the core test from silently landing on an incapable runner.

{
echo "OPENSANDBOX_API_KEY=$api_key"
echo "OPENSANDBOX_BASE_URL=http://127.0.0.1:8081"
echo "OPENSANDBOX_WINDOWS_IMAGE=dockurr/windows:latest"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Please pin the Windows image by digest rather than using dockurr/windows:latest. This image runs on a privileged, KVM/TUN-capable self-hosted runner with host networking, so a mutable tag creates a meaningful supply-chain and reproducibility risk.

}

func quoteCmdPath(value string) string {
return `"` + strings.ReplaceAll(value, "%", "%%") + `"`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] This is not sufficient cmd.exe quoting for a configuration-controlled path. Doubling % does not handle embedded ", &, |, <, >, ^, or delayed-expansion !; an input such as a crafted workspace_mount can terminate the quoted argument and alter the fallback command when CreateDirectory fails. Please use the shared cmd quoter if it covers path operands, or reject/escape cmd metacharacters here, and add adversarial tests.

return errs
}

func validateOpenSandboxResources(env Environment) []string {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] cpu, memory, and disk are only checked for whitespace-only values, so arbitrary strings and unbounded requests pass validation and fail later—or consume excessive resources if accepted by the server. Please validate the SDK/server-supported syntax and document/enforce where quotas live, or explicitly document that these opaque values are intentionally delegated to a quota-enforcing OpenSandbox server.

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.

OpenSandbox Windows guest profile (wait on Go SDK Platform field)

4 participants