Skip to content

feat(openshell-provider): pass OpenShell's driver_config through on sandboxes - #13304

Merged
cv merged 1 commit into
v1from
feat/sandbox-driver-config
Oct 16, 2026
Merged

cv merged 1 commit into
v1from
feat/sandbox-driver-config

Conversation

@cv

@cv cv commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Closes #13150. Part of #13131.

Failure

Agents need files that outlive a sandbox, such as skills. The earlier plan in #13150 was a fabric_skill data source waiting on OpenShell mounts that work on every platform. That was unnecessary:

  • OpenShell v0.1.4 already has mounts: sandbox templates carry per-driver mounts in driver_config. Docker and Podman accept named volumes, tmpfs and bind mounts; Kubernetes accepts PersistentVolumeClaims.
  • Fabric already takes skill paths: fabric_agent's skills block is Fabric's own skills.paths.

The gap was that openshell_sandbox couldn't pass driver_config.

Decision

  • New input: openshell_sandbox takes an optional driver_config, OpenShell's SandboxTemplate.driver_config as JSON text (usually from jsonencode()). It's passed through unchanged; NemoClaw adds nothing, so OpenShell's defaults apply, including read_only on mounts.
  • Read-back: OpenShell stores numbers as doubles, so whole numbers are written back as integers and an unchanged input plans no change.
  • Immutable, like the image: a changed input, or a different configuration observed on the gateway, would replace the sandbox, and the provider refuses that.
  • Gateways: managed gateways keep OpenShell's default, with driver configuration disabled. Gateways configured to allow it accept the input.
  • Skills: no fabric_skill type. docs/agents.md shows a mounted volume with fabric_agent's skills pointing at it, and notes that mount settings and filesystem policy decide write access, and that the volume's contents outlive the sandbox.
  • Dependency: prost-types becomes a workspace dependency, at the version openshell-core already uses.

Found along the way, not changed here: a sandbox without providers fails during apply with observation query failed, although the schema marks providers optional. The new contract test attaches a web search provider.

Validation

  • New unit tests for the conversion failed before the change: round trip, whole numbers, fractions, no configuration, invalid input.
  • A new contract test runs against pinned OpenTofu and the fake gateway. It checks that the gateway receives the configuration unchanged, that re-planning shows no change, and that both a changed input and drift on the gateway are refused as replacements.
  • cargo ci passes locally: 1534 unit tests and 145 lifecycle tests. The docs check reports 0 errors.

…andboxes

openshell_sandbox takes an optional driver_config: OpenShell's
SandboxTemplate.driver_config as JSON text, passed through unchanged so
OpenShell's defaults apply. It is part of the immutable sandbox
specification; read-back writes whole numbers as integers so an unchanged
input plans no change. Skills on a mounted volume use fabric_agent's
existing skills paths, so no fabric_skill type is needed.
@github-actions

Copy link
Copy Markdown
Contributor

@cv
cv enabled auto-merge (squash) October 16, 2026 03:58
@cv
cv merged commit e061963 into v1 Oct 16, 2026
@cv
cv deleted the feat/sandbox-driver-config branch October 16, 2026 03:58
cv added a commit that referenced this pull request Oct 16, 2026
Part of #13131.

## Failure

`openshell_sandbox` marks `providers` as optional, but a sandbox with
none failed during apply with `observation query failed`, before any
request reached the gateway. `provider_names` treated an omitted or
empty list as invalid, and so did the inference environment built from
it. Found while adding `driver_config` in #13304.

## Decision

- **No providers is valid:** an omitted `providers`, or `providers =
[]`, attaches no providers.
- **Recorded as written:** NemoClaw records the attachment list in the
sandbox environment (`NEMOCLAW_PROVIDER_NAMES`) only to read it back,
and nothing in the images reads it. It's now recorded exactly as written
and omitted when `providers` is omitted, so both forms read back
unchanged.
- **Other checks unchanged:** duplicate and invalid names, and lists
over 128, are still rejected. The check that a cluster-source inference
profile's provider is attached to the sandbox correctly fails when
nothing is attached.

## Validation

- A new unit test failed before the fix: an omitted list and `[]` both
attach nothing, and only an explicit list is recorded in the
environment.
- A new contract test applies one sandbox without `providers` and one
with `providers = []` against pinned OpenTofu and the fake gateway, then
expects a no-op plan.
- `cargo ci` passes locally: 1535 unit tests and 146 lifecycle tests.
cv added a commit that referenced this pull request Oct 18, 2026
Closes #13398. Part of #13394.

## Failure

`openshell_sandbox` passes OpenShell's `driver_config` through unchanged
(#13304). That's how a sandbox gets mounts, such as a skills volume that
outlives the sandbox. The YAML sandbox had no matching field, so mounts
were HCL-only.

## Decision

- A sandbox's `driverConfig` holds OpenShell's per-driver configuration,
written as YAML and passed through unchanged. NemoClaw sets nothing in
it; OpenShell's defaults and the gateway's driver-configuration setting
apply.
- The SDK carries it in the sandbox row's `driver_config_json`, like
`policy_json`, so it reaches OpenTofu through the same structured-input
conversion as the HCL attribute.

## Validation

- A new SDK test failed before the change (`unknown fields are not
allowed`) and passes after. It checks the compiled `openshell_sandbox`
with and without the field, and that the document round-trips.
- `cargo ci` passes locally: 1543 unit tests and 151 lifecycle tests.
- The schema and the configuration reference are regenerated.
`docs/agents.md` shows mounting a skills volume in YAML as well as HCL.
cv added a commit that referenced this pull request Oct 18, 2026
…#13425)

Closes #12639 under its narrowed documentation scope.

## Failure

A sandbox can declare `driverConfig`, for example to mount volumes that
outlive it (#13304, #13402). The docs on keeping agent files on mounted
volumes (#13410) said the gateway must allow driver configuration, but
no NemoClaw-managed gateway could. Every gateway NemoClaw installs kept
OpenShell's default, `allow_driver_config = false`, and rejected the
sandbox. So the mounted-volume path worked only with external gateways,
and the docs said that retention through a sandbox replacement had not
been qualified.

## Decision

- **`spec.gateway.sandboxDriverConfig`:** for managed gateways, with
`allow` (default `false`) and an optional `resourceAdmission`
(`enabled`, `requiredLabels`), passed through to OpenShell unchanged.
- **Docker and Podman:** written into the gateway's `gateway.toml`
driver section. The file lives in the gateway's retained storage, so the
setting is fixed when the deployment is created, as with the other
settings stored there. Without the setting, the file is unchanged byte
for byte, so existing gateways still match.
- **Kubernetes:** written into the chart's `server.drivers.kubernetes`
values, which Helm applies in place.
- **How the Docker and Podman resources carry it:** the gateway and
gateway-storage resources take it as an optional `sandbox_driver_config`
attribute, following the `image_pull_policy` pattern.
- **One local check:** an empty `requiredLabels` map is rejected before
apply. OpenShell refuses it at gateway start, and on Docker or Podman
the value would already be fixed in storage.
- **Docs:**
- the mounted-volume guide shows the gateway setting next to the sandbox
mounts;
  - retention through replacement is recorded as verified;
- references to #12639 are reworded to say who owns each remaining
limit: conversation continuity belongs to Fabric and the harness, moving
storage belongs to the platform.

## Validation

- **New tests** failed before the change:
- Docker and Podman `gateway.toml` contents, with and without the
setting;
  - empty `requiredLabels` rejected;
  - chart values for Kubernetes.
- **`cargo ci`** passes locally: 1,597 unit tests and 149 lifecycle
tests. The docs check reports 0 errors.
- **Live, on a managed Docker gateway:**
1. A deployment with `sandboxDriverConfig.allow: true` mounted two
volumes carrying OpenShell's default admission labels.
2. Markers were written into `/sandbox/workspace` and
`/sandbox/artifacts`.
3. An agent change replaced the sandbox (`openshell_sandbox`
delete/create; new container).
  4. Both markers were read back from the new sandbox.
  5. Destroy and the documented removal procedure left nothing behind.
@wscurran wscurran added area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery area: security Security controls, permissions, secrets, or hardening feature PR adds or expands user-visible functionality platform: container Affects Docker, containerd, Podman, or images platform: k8s Affects Kubernetes deployments v1 NemoClaw v1 branch labels Oct 26, 2026
@cv cv added this to the Roadmap: GTC DC 2026 milestone Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery area: security Security controls, permissions, secrets, or hardening feature PR adds or expands user-visible functionality platform: container Affects Docker, containerd, Podman, or images platform: k8s Affects Kubernetes deployments v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants