Skip to content

feat(config): let managed gateways allow sandbox driver configuration - #13425

Merged
cv merged 4 commits into
v1from
feat/gateway-driver-config
Oct 18, 2026
Merged

cv merged 4 commits into
v1from
feat/gateway-driver-config

Conversation

@cv

@cv cv commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

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 Back up, restore, and transfer native agent data #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.

cv added 4 commits October 18, 2026 08:38
Sandboxes can declare driverConfig, such as mounted volumes, but every
NemoClaw-managed gateway kept OpenShell's default and rejected it.
spec.gateway.sandboxDriverConfig passes allow_driver_config and
resource_admission through: into gateway.toml for Docker and Podman, where
it is fixed with the gateway's retained storage, and into the chart's
server.drivers.kubernetes values for Kubernetes.
@cv
cv enabled auto-merge (squash) October 18, 2026 15:46
@github-actions

Copy link
Copy Markdown
Contributor

@cv
cv merged commit 86035ea into v1 Oct 18, 2026
@cv
cv deleted the feat/gateway-driver-config branch October 18, 2026 16:08
cv added a commit that referenced this pull request Oct 18, 2026
…y fails (#13426)

Part of #12692.

## Failure


`kubernetes_live::oidc::a_managed_gateway_accepts_an_existing_issuers_tokens_and_refuses_another_audience`
failed once in CI (linux_amd64, on #13425). It passed on rerun, on `v1`
at the same base, and locally on ARM64. The log held only the SDK's
summary, `Apply incomplete / observation query failed`, so there was no
way to tell why.

The obvious guess was that the gateway started before the issuer's CA
ConfigMap existed. The pinned chart rules that out: it mounts the
ConfigMap as a required volume, so the gateway pod waits for it.

## Decision

Diagnose rather than guess. When the test's apply fails, it now prints
the deployment namespace's:

- pods, with each container's readiness, restarts and waiting or
terminated state;
- 15 most recent events;
- last 40 log lines of each container.

Then it fails with the same message as before. Test-only; production
code is unchanged.

## Validation

- `cargo ci` passes locally: 1,598 unit tests and 149 lifecycle tests.
- `cargo ci live-kind` passes locally: all 7 tests. The diagnostics only
run on failure.
cv added a commit that referenced this pull request Oct 19, 2026
## Failure

`nemoclaw apply` refused any authored change that would replace or
remove a bound sandbox, before planning:

> apply cannot replace sandbox 'assistant'; its files and conversation
history are not separately retained

This covered a different harness adapter, sandbox image or network
policy, and removing a sandbox from the configuration. The guard
(`State::validate_bound_sandboxes`, added in September) predates #13375,
which made sandboxes replaceable. It contradicted:

- **#13375's design:** a change that needs a new sandbox replaces it,
and the plan shows it.
- **The docs:** the change-path table in `docs/usage.md` says a harness,
image or driver configuration change "replaces the sandbox" and removing
a sandbox "deletes it".
- **Hand-written HCL,** which replaces sandboxes normally.

Only changes to an agent's configuration got through, because they live
in a separate target. It surfaced while switching the harness of a
running DGX Spark deployment.

## Decision

Remove the guard, its error variant and the CLI help text for it.
OpenTofu plans the replacement or deletion like any other change, and
the existing plan output warns that it "deletes sandbox files and
conversation history". Files that must outlive a sandbox belong on
mounted volumes (#13425). The unrelated check that keeps an unfinished
creation's configuration stays.

## Validation

- **Rewritten SDK test (`sandbox_admission`):** removing, re-imaging or
re-policing a bound sandbox reaches planning without changing intent or
state. It failed before the change with the refusal error.
- **Lifecycle tests:**
- **`fabric_deployment`:** an adapter change applies, replacing the
sandbox, and changing it back replaces it again.
- **`remote_service`:** a replacement whose new images fail their checks
stops before any change, keeping intent and state. It's renamed from
"refused" to "failed".
- **The live shared-service test (`shared_service`):** removing one
consumer now deletes only that sandbox, leaving the shared model service
and the other consumer untouched, and re-adding it creates a new
sandbox. It's ignored by default and wasn't run here.
- `cargo ci` passes locally: 1,598 unit tests and 149 lifecycle tests.
@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 labels Oct 23, 2026
@wscurran wscurran added the v1 NemoClaw v1 branch label Oct 28, 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