Skip to content

fix(sdk): let apply replace or remove sandboxes as planned - #13434

Merged
cv merged 1 commit into
v1from
fix/sandbox-change-guard
Oct 19, 2026
Merged

cv merged 1 commit into
v1from
fix/sandbox-change-guard

Conversation

@cv

@cv cv commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

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:

  • feat: replace an agent's sandbox when its configuration changes #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.

The SDK refused any authored change that would replace or remove a bound
sandbox before planning. That guard predates sandboxes becoming replaceable
and contradicted the documented change paths. OpenTofu now plans such changes
like any other, with the existing data-loss warning.
@cv
cv enabled auto-merge (squash) October 18, 2026 23:53
@github-actions

Copy link
Copy Markdown
Contributor

cv added a commit that referenced this pull request Oct 19, 2026
## Failure

The ARM64 vLLM runtime (`runtimes/vllm`) built on an upstream
`vllm/vllm-openai` image published under the tag `qwen38-flash-next`,
which isn't a vLLM release. Whether it served the GTC DC templates'
model, Nemotron 3 Super 120B NVFP4, was untested. The GTC DC README
called all nine templates "planned configurations", and still said apply
fails an agent health check that no longer exists.

## Decision

- **The runtime base** is the vLLM v0.32.0 release (today's latest),
pinned by its multi-platform digest. `runtimes/qwen38` keeps its own
base, built for that model.
- **The GTC DC README** records results from a DGX Spark run of the
Spark templates, and drops the stale health-check sentence. The three
Spark templates' headers say what was verified.
- **Not changed:** the AMD64 runtime (`runtimes/vllm-amd64`, vLLM
0.27.1), because it can't be verified on AMD64 GPU hardware here.

## Validation

On a DGX Spark, with this runtime image and agent images built from
`v1`, plus #13434 and #13435:

- **Model service:** the Hermes template applied in about 72 minutes,
mostly a 74.8 GiB download at about 20 MiB/s and a 15-minute load. vLLM
v0.32.0 used FlashInfer's NVFP4 kernels on the GB10. Requests without
the key were refused with `401`, and requests with it succeeded.
- **Hermes:** a short answer in 4 seconds once warm; a terminal tool
call returned the exact hash in 17 seconds; a five-point itinerary in
14.5 seconds, within the 1,024-token limit.
- **Deep Agents:** switching the deployment's harness replaced only the
sandbox, in 28 seconds, while the model kept serving. Short answers took
5–6 seconds, the itinerary 18 seconds, and a write-then-read file task
with three tool calls 29 seconds, returning the file's contents.
- **OpenClaw:** agent start fails, as tracked in #13372. Inside the
sandbox, `setpriv` reports "initgroups failed: Operation not permitted"
(NVIDIA/NeMo-Fabric#430).
- **Destroy** took 9 seconds and kept the model cache, gateway storage
and credentials.

The run found two bugs, fixed separately:

- **#13434:** the SDK refused harness and image changes that should
replace the sandbox.
- **#13435:** services with host IPC planned a replacement on every
reapply.

`cargo ci` passes locally: 1,598 unit tests and 149 lifecycle tests.
@cv
cv merged commit fc54a41 into v1 Oct 19, 2026
@cv
cv deleted the fix/sandbox-change-guard branch October 19, 2026 01:56
cv added a commit that referenced this pull request Oct 19, 2026
## Failure

The live Kind suite exceeded its 270-second wall budget on #13434 (279
s), although all 7 tests passed. The four cluster tests ran one at a
time, so their durations added up. A run that recorded the cluster's
events showed where the time went. In each of the three tests that
deploy a sandbox, about 31 seconds pass between Kubernetes stopping the
sandbox's `agent` and `supervisor` containers and the next destroy step.
That's the default 30-second termination grace period expiring, because
those OpenShell containers don't exit on `SIGTERM`. That's about 95 of
231 seconds locally.

## Decision

Keep every check, and stop paying those waits one after another:

- **Side by side:** the live Kind profile runs up to four tests at once.
Each cluster test already uses its own namespace, Helm release, issuer
namespace and local ports, and after a run the cluster holds no per-test
cluster-wide objects.
- **The registry test runs alone** (`threads-required =
"num-test-threads"`). It seeds its private registry by tagging, pushing
and untagging the node's shared agent image. In the first side-by-side
attempt, the OIDC test's sandbox failed to pull that image
(`ErrImagePull … failed to resolve reference`) while the registry test
ran.

Not changed: the grace period itself. Shortening it from NemoClaw would
work around OpenShell's signal handling, and force-deleting pods in
tests would stop testing the real destroy path.

## Validation

`cargo ci live-kind` locally: all 7 tests pass, in 175.6 s of wall time,
down from 231 s run one at a time.
@wscurran wscurran added area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery bug-fix PR fixes a bug or regression 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 bug-fix PR fixes a bug or regression v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants