Skip to content

feat(custom): run approved harnesses through common Sandbox - #354

Merged
FumingZhang merged 3 commits into
mainfrom
feat/custom-sandbox-runtime
Oct 29, 2026
Merged

FumingZhang merged 3 commits into
mainfrom
feat/custom-sandbox-runtime

Conversation

@FumingZhang

@FumingZhang FumingZhang commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Summary

Run approved Custom harnesses through the existing common Sandbox executor on Kata and the ordinary-container backend, without introducing another lifecycle engine or treating a Custom image as a managed harness.

  • Preserve the image entrypoint and numeric non-root user; reuse owned HOME, immutable canonical context, resource/security controls, and per-Agent Gateway accounting.
  • Wire headless, private Chat and authenticated Web UI contracts, a static loopback HTTP probe, and an isolated platform terminal with current-execution CONNECT authorization.
  • Support retained restart, suspension/resume, healthy-source migration, ordinary deletion, private registry projection/rotation and current Copilot proxy projections.
  • Update policy CRDs, the Portal policy editor, current Chat execution proof and read-only RBAC, helper packaging, tests and documentation.

Related issue

Reuses the Custom-specific implementation from #350 as an independently reviewable change. It does not import mandatory governance for every Agent, removal of existing ungoverned paths, or running Team changes. #350 and #353 are unchanged.

Based on main c5f0eb827, retaining the newly merged credential-policy and OpenClaw startup fixes from #346 and #352.

Validation

Offline checks use Go 1.27.3, controller-gen v0.21.0, Helm 3.22.1, local Kubernetes/envtest 1.37.0 and Hugo 0.164.0 extended. Dependencies were restored from pinned local caches; no live cluster or identity-provider access was used.

Command: make -C app/cetirun-operator test
Result: passed all packages; controller package 820.139s.

Command: go -C app/cetirun-operator test -tags=envtest ./internal/controller -run '^TestCommonCustom(Terminal)?APIServer$|^TestNativeConnections|^TestConnections.*APIServer$' -count=1 -timeout=10m
Result: passed, 109.875s. Real local API defaulting, ownership, named source RBAC and Pod admission; synthetic Gateway/scheduler/kubelet observations.

Command: go -C app/cetirun-operator test -race ./internal/controller -run 'TestCommonCustom|TestApplyCopilot|TestCopilotResponsesModelsReachTheProxy|TestReconciledSandboxRegistry|Test.*Connections|Test.*CredentialPolicy' -count=1 -timeout=20m
Result: passed, 413.017s, including the synchronized concurrent registry-audit test recorder.

Command: go -C app/cetirun-portal test -race ./... -count=1 -timeout=10m
Result: passed with pinned Helm on PATH.

Command: go -C app/internal test -race ./... -count=1 -timeout=5m
Command: go -C app/cetirun-agent-broker test -race ./... -count=1 -timeout=10m
Command: go -C app/cetirun-connections-mcp test -race ./... -count=1 -timeout=5m
Result: passed all three consumer modules after main integration.

Command: make portal-test portal-lint
Command: npm --prefix app/cetirun-portal/web run build
Result: passed 475 frontend tests, 34 license-tool tests, TypeScript and the real production build.

Command: make -C app/cetirun-operator generate manifests check-crds
Result: passed; CRDs regenerated with the pinned generator.

Command: make chart-check go-lint docs-check
Result: passed chart gates, vet for all consumer modules, 106 documentation tests and 41 rendered-page checks.

Command: make -C app/cetirun-operator build build-terminal
Command: make -C app/cetirun-portal build
Result: passed Operator, terminal, static HTTP probe and Portal builds.

Command: python3 -B -m unittest discover -s scripts/tests -p test_custom_initialization.py -v
Result: passed 25 initialization/context regressions.

Command: make ci-test
Result: passed 114 CI helper tests and 731 script tests (one pre-existing optional skip), including the exact read-only Chat RBAC contract and namespace wiring.

Not run: live Kata/runc, Cilium/CSI, real Custom model/tool journeys, real provider credentials, browser-to-cluster terminal sessions, image publication or deployment.

The initial unfiltered controller race run exceeded its aggregate 20-minute package limit while an existing migration case was running; it did not report an assertion failure before the limit. The full ordinary unit gate passed. No runtime/lifecycle deadline or repository test budget was increased.

Compatibility and operational impact

Custom remains opt-in: the Team must permit custom, the common executor and backend must be registered, and the image digest must be approved and Gateway-qualified. HTTP probing and terminal access require a pinned platform terminal image. The terminal has independent network/RBAC authority and receives no Agent HOME or model credential. Portal adds get-only Cilium access and namespaced execution-ConfigMap access, not Secret access.

The current common Custom path explicitly rejects desktop, ingress mTLS and Agent Identity/Connections execution. Scoped Kubernetes and Entra/FQDN integration require their separately delivered adapters and qualification. This PR is not a claim that the complete live Custom acceptance matrix or identity-provider qualification is finished.

Deploy matching Operator/admission, runtime chart and Portal artifacts. Existing managed harness behavior and the non-Sandbox Custom path are preserved. The Portal module records already-pinned indirect dependencies exposed by its local Operator dependency; no dependency versions are upgraded.

Checklist

  • The change is focused and preserves unrelated work.
  • Tests cover the changed behavior, or I explained why no new test is needed.
  • Documentation and examples match any public behavior changes.
  • Generated artifacts were updated from source, or none are affected.
  • Dependency changes include lockfiles, source attribution, and license information, or none are affected.
  • I checked the diff and attachments for secrets, private endpoints or identifiers, customer data, agent conversations, and internal information.
  • I followed the applicable CLA instructions, or asked a maintainer about an unclear check.
  • I identified checks that need credentials or a live environment and did not run them without authorization.

FumingZhang and others added 3 commits October 29, 2026 06:58
Reuse the common executor for governed Custom creation, retained lifecycle, typed Gateway and network controls, private Chat and isolated terminal access. Preserve image entrypoints and non-root identities while retaining existing managed and non-Sandbox behavior.\n\nInclude generated policy schemas, Portal wiring, static probe packaging and offline regression coverage. Keep unsupported identity, mTLS and desktop combinations fail-closed and document the live qualification boundary.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Retain Custom ingress and terminal contracts alongside native identity pinning and expectation validation. Update the Entra renderer tests for the shared validation signature and preserve fail-closed handling of unsupported Custom Entra projection.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Yield to the Node scheduler within act before arming the window access trap. Preserve the stale-dispatch negative control and late Chat completion assertions without retries or a longer timeout.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@feiskyer Pengfei Ni (feiskyer) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@FumingZhang
FumingZhang merged commit 6293745 into main Oct 29, 2026
33 checks passed
@FumingZhang
FumingZhang deleted the feat/custom-sandbox-runtime branch October 29, 2026 23:19
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