Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .agents/skills/nemoclaw-v0-migration/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,12 @@ For each report entry, confirm that Agent Configs supports the setting in both s
`settings_schema` holds what `harness.settings` accepts, and `model_schema` holds what a route's `overrides.settings` accepts.

If the schema lacks the field, or its meaning differs from the meaning in NemoClaw v0, don't write it: tell the user the setting is lost.
The table shows what the pinned Fabric adapters accept; the image's descriptor decides.
Check the image's descriptor alongside the native-runtime limitations in the [migration guide](../../../docs/get-started/migration.md#mapping-the-user-task); schema acceptance alone does not establish runtime support.

| Report field | Agent Configs setting | Notes |
|---|---|---|
| `image.ref` (placeholder) | `sandboxes.<name>.image.ref` | Step 4 |
| `execution.heartbeatEvery` | OpenClaw: `harness.settings.agents.defaults.heartbeat.every` | Same duration format, such as `30m`. Hermes has no heartbeat setting. |
| `execution.heartbeatEvery` | Follow the [current migration guidance](../../../docs/get-started/migration.md#mapping-the-user-task) | Report when no supported equivalent exists; do not generate an unsupported setting. |
| `tools.disclosure` | `progressive`: OpenClaw `harness.settings.tools.toolSearch: true`; Hermes `harness.settings.tools.tool_search.enabled: on`. `direct`: `false` and `off` | In NemoClaw v0, `progressive` uses the agent's native tool search and `direct` shows every tool, which matches these fields' descriptions in the adapters' `settings_schema`. Write the value explicitly: when it's omitted, the adapters keep the native release's default, which neither the schema nor Fabric's adapter docs state. Tell the user the setting is now explicit. See [agent tool restrictions](../../../docs/agents-inference/agents.md#agent-tool-restrictions). |
| `interfaces` | `harness.settings.interfaces`: OpenClaw `dashboard`; Hermes `api`, `dashboard` | Write each interface that was enabled in NemoClaw v0, with its `port`, after the user confirms; skip one with `enabled: false`. The port is inside the sandbox; when forwarding it, choose a local port that the existing port forward doesn't hold. See [native interfaces](../../../docs/agents-inference/agents.md#native-interfaces) and [interfaces](../../../docs/agents-inference/interfaces.md). |
| `inference.reasoning`, `inference.reasoningEffort` | None for OpenClaw | The OpenClaw adapter's model schema has no reasoning field. Hermes's `harness.settings.reasoning_config` exists, but NemoClaw v0 reports these only for OpenClaw. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ Confirm the native `write_file` tool remains available when Config change remove

For the pinned Fabric local host, stderr is `TMPDIR/nemo-fabric/hosts/RUNTIME_ID/host.stderr.log`.
Resolve `TMPDIR` from the image runtime metadata and control-process launch binding, not from an arbitrary exec shell or a full environment dump.
The NemoClaw image runtime metadata sets it to `/sandbox/tmp`.
Set `RUNTIME_TMPDIR` to that verified value; do not inherit the operator shell's temporary directory.
With that binding confirmed, collect before any transition removes the host directory:

```sh
openshell sandbox exec -n assistant --no-tty -- cat "/sandbox/tmp/nemo-fabric/hosts/$RUNTIME_ID/host.stderr.log" > "$CHECK_DIR/registration.txt"
openshell sandbox exec -n assistant --no-tty -- cat "${RUNTIME_TMPDIR:?Set RUNTIME_TMPDIR from the runtime binding}/nemo-fabric/hosts/$RUNTIME_ID/host.stderr.log" > "$CHECK_DIR/registration.txt"
```

Preserve the complete ordered discovery block, redact credentials, and record the runtime ID and startup boundary.
Expand Down
55 changes: 36 additions & 19 deletions crates/nemoclaw-build/src/images.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,8 +669,9 @@ pub fn build(

/// Facts about an image's assembly, gathered by its own shell: the files its
/// provenance and runtime declare, the hashes of its retained sources, its user,
/// the owners and modes under `/sandbox`, any installer or toolchain left, and
/// what Hermes's own interfaces need in a Hermes image.
/// the owners and modes under `/sandbox` and of the `TMPDIR` its runtime
/// declares, any installer or toolchain left, and what Hermes's own interfaces
/// need in a Hermes image.
const ASSEMBLY_FACTS: &str = r#"
echo '=== provenance'; cat /opt/nemoclaw/provenance.json; echo
echo '=== runtime'; cat /opt/nemoclaw/runtime.json; echo
Expand All @@ -682,6 +683,9 @@ for file in /opt/nemoclaw/*.py; do
done
echo '=== identity'; echo "$(id -u) $(id -g)"
echo '=== sandbox'; find /sandbox -exec stat -c '%u %a %F %n' {} +
echo '=== temporary'
temporary=$(/opt/fabric/bin/python -c 'import json; print(json.load(open("/opt/nemoclaw/runtime.json")).get("environment", {}).get("TMPDIR", ""))' 2>/dev/null)
[ -n "$temporary" ] && stat -c '%u %a %F %n' "$temporary" 2>/dev/null
echo '=== installers'; ls -d /opt/fabric/bin/pip* /opt/fabric/lib/python*/site-packages/pip 2>/dev/null || true
echo '=== toolchains'; for tool in rustc cargo uv gcc; do command -v "$tool" || true; done
echo '=== control'
Expand Down Expand Up @@ -813,22 +817,25 @@ pub fn check_assembly(facts: &str) -> Vec<String> {
));
}
}
// Each line is `stat -c '%u %a %F %n'`: owner, octal mode, type, and path.
let entries_of = |name: &str| {
section(name)
.into_iter()
.filter_map(|line| {
let mut parts = line.splitn(3, ' ');
let owner = parts.next()?;
let mode = u32::from_str_radix(parts.next()?, 8).ok()?;
let rest = parts.next()?;
let directory = rest.starts_with("directory ");
let path = rest.split_once(" /").map(|(_, path)| path)?;
Some((owner, mode, directory, path))
})
.collect::<Vec<_>>()
};
// OpenShell seeds a Kubernetes workspace by copying the image's /sandbox, as
// the namespace's own UID on OpenShift, and its supervisor makes probe
// directories under TMPDIR before Fabric starts. So /sandbox and TMPDIR
// belong to 10001, and everything in /sandbox is readable by others.
let entries: Vec<(&str, u32, bool, &str)> = section("sandbox")
.iter()
.filter_map(|line| {
let mut parts = line.splitn(3, ' ');
let owner = parts.next()?;
let mode = u32::from_str_radix(parts.next()?, 8).ok()?;
let rest = parts.next()?;
let directory = rest.starts_with("directory ");
let path = rest.split_once(" /").map(|(_, path)| path)?;
Some((owner, mode, directory, path))
})
.collect();
// the namespace's own UID on OpenShift. Everything in /sandbox must be
// readable by others.
let entries = entries_of("sandbox");
let owned_directory = |wanted: &str| {
entries.iter().any(|(owner, _, directory, path)| {
format!("/{path}") == wanted && *directory && *owner == "10001"
Expand All @@ -837,12 +844,22 @@ pub fn check_assembly(facts: &str) -> Vec<String> {
if !owned_directory("/sandbox") {
problems.push("/sandbox is not a directory owned by 10001".into());
}
// Kubernetes can mount a world-writable /sandbox without sticky protection;
// OpenClaw refuses temporary files beneath that ancestor. Keep TMPDIR outside
// the workspace, writable by arbitrary OpenShift UIDs, with the sticky bit
// protecting each user's files.
let temporary = runtime["environment"]["TMPDIR"]
.as_str()
.unwrap_or_default();
if !temporary.starts_with("/sandbox/") || !owned_directory(temporary) {
let outside = temporary != "/sandbox" && !temporary.starts_with("/sandbox/");
let protected = entries_of("temporary")
.iter()
.any(|(owner, mode, directory, path)| {
format!("/{path}") == temporary && *directory && *owner == "0" && *mode == 0o1777
});
if !outside || !protected {
problems.push(format!(
"TMPDIR {temporary} is not a directory in /sandbox owned by 10001"
"TMPDIR {temporary} is not a root-owned directory with mode 1777 outside /sandbox"
));
}
for (_, mode, directory, path) in &entries {
Expand Down
54 changes: 48 additions & 6 deletions crates/nemoclaw-build/tests/qualify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ const CATALOG: &str = "c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c
fn facts() -> String {
let provenance = json!({"harness": "agent", "source_sha256": FABRIC,
"requirements_sha256": REQUIREMENTS, "local_sources": {"catalog.py": CATALOG}});
let runtime = json!({"environment": {"TMPDIR": "/sandbox/tmp"}});
let runtime = json!({"environment": {"TMPDIR": "/tmp"}});
format!(
"=== provenance\n{provenance}\n=== runtime\n{runtime}\n=== hashes\n\
{FABRIC} fabric.tar.gz\n{REQUIREMENTS} requirements.txt\n{CATALOG} local/catalog.py\n\
=== copies\nsame catalog.py\n=== identity\n10001 10001\n=== sandbox\n\
10001 755 directory /sandbox\n10001 755 directory /sandbox/tmp\n10001 644 regular file /sandbox/.profile\n\
10001 755 directory /sandbox\n10001 755 directory /sandbox/.cache\n10001 644 regular file /sandbox/.profile\n\
=== temporary\n0 1777 directory /tmp\n\
=== installers\n=== toolchains\n=== control\nexecutable\n"
)
}
Expand All @@ -29,6 +30,43 @@ fn an_image_that_meets_the_contract_has_no_problems() {
assert_eq!(check_assembly(&facts()), Vec::<String>::new());
}

/// Kubernetes replaces /sandbox with a workspace volume whose mode the image
/// doesn't set, and OpenShift runs sandboxes as an arbitrary UID, so the
/// TMPDIR the runtime declares is a root-owned sticky directory outside it.
#[test]
fn tmpdir_is_a_root_owned_sticky_directory_outside_sandbox() {
for (tmpdir, entry, accepted) in [
("/tmp", "0 1777 directory /tmp", true),
("/var/tmp", "0 1777 directory /var/tmp", true),
("/tmp", "0 777 directory /tmp", false),
("/tmp", "0 1755 directory /tmp", false),
("/tmp", "10001 1777 directory /tmp", false),
("/tmp", "0 1777 regular file /tmp", false),
("/var/tmp", "0 1777 directory /tmp", false),
("/sandbox/tmp", "10001 755 directory /sandbox/tmp", false),
("/sandbox/tmp", "0 1777 directory /sandbox/tmp", false),
] {
let mut observed = facts()
.replace(r#""TMPDIR":"/tmp""#, &format!(r#""TMPDIR":"{tmpdir}""#))
.replace("0 1777 directory /tmp\n", &format!("{entry}\n"));
if tmpdir.starts_with("/sandbox/") {
// The image's listing of /sandbox names it too.
observed = observed.replace("=== temporary\n", &format!("{entry}\n=== temporary\n"));
}
let problems = check_assembly(&observed);
if accepted {
assert_eq!(problems, Vec::<String>::new(), "{tmpdir}: {entry}");
} else {
assert!(
problems
.iter()
.any(|found| found.contains(&format!("TMPDIR {tmpdir}"))),
"{tmpdir}: {entry} -> {problems:?}"
);
}
}
}

#[test]
fn each_assembly_problem_is_named() {
for (from, to, problem) in [
Expand All @@ -53,16 +91,20 @@ fn each_assembly_problem_is_named() {
"0 755 directory /sandbox\n",
"/sandbox",
),
("10001 755 directory /sandbox/tmp\n", "", "/sandbox/tmp"),
(
"=== temporary\n0 1777 directory /tmp\n",
"=== temporary\n",
"TMPDIR /tmp",
),
(
"10001 644 regular file",
"10001 600 regular file",
"/sandbox/.profile",
),
(
"10001 755 directory /sandbox/tmp",
"10001 750 directory /sandbox/tmp",
"/sandbox/tmp",
"10001 755 directory /sandbox/.cache",
"10001 750 directory /sandbox/.cache",
"/sandbox/.cache",
),
(
&format!("{FABRIC} fabric.tar.gz"),
Expand Down
26 changes: 25 additions & 1 deletion crates/nemoclaw-e2e/cases/kind-kubernetes-development.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

# One agent on a managed gateway in a kind cluster with the defaults: the
# One agent on a managed gateway in a kind cluster with the default
# kubernetes runtime profile and the development authentication profile, in
# which the SDK issues the gateway's tokens. Its inference route reaches a
# stub model in its own namespace, and the agent image comes from a private
Expand All @@ -28,6 +28,7 @@ spec:
profile: development
config:
openshell.drivers.kubernetes:
allow_driver_config: true
image_pull_secrets:
- agent-registry
inferenceProviders:
Expand All @@ -48,6 +49,29 @@ spec:
ref: nc-registry:5000/agent@sha256:0000000000000000000000000000000000000000000000000000000000000000
metadata:
env: NEMOCLAW_TEST_AGENT_METADATA
# The platform prepares private subdirectories; never mount the PVC root.
driverConfig:
kubernetes:
volumes:
- name: agent-data
persistent_volume_claim:
claim_name: assistant-data
read_only: false
containers:
agent:
volume_mounts:
- name: agent-data
mount_path: /sandbox/artifacts
sub_path: artifacts
read_only: false
- name: agent-data
mount_path: /sandbox/workspace
sub_path: workspace
read_only: false
- name: agent-data
mount_path: /sandbox/.cache
sub_path: cache
read_only: false
network:
policy:
explicit:
Expand Down
47 changes: 47 additions & 0 deletions crates/nemoclaw-e2e/cases/kind-kubernetes-oidc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ spec:
user_role: nemoclaw-development-user
scopes_claim: scope
openshell.drivers.kubernetes:
allow_driver_config: true
image_pull_secrets:
- agent-registry
inferenceProviders:
Expand All @@ -69,6 +70,29 @@ spec:
ref: nc-registry:5000/agent@sha256:0000000000000000000000000000000000000000000000000000000000000000
metadata:
env: NEMOCLAW_TEST_AGENT_METADATA
# The platform prepares private subdirectories; never mount the PVC root.
driverConfig:
kubernetes:
volumes:
- name: agent-data
persistent_volume_claim:
claim_name: assistant-data
read_only: false
containers:
agent:
volume_mounts:
- name: agent-data
mount_path: /sandbox/artifacts
sub_path: artifacts
read_only: false
- name: agent-data
mount_path: /sandbox/workspace
sub_path: workspace
read_only: false
- name: agent-data
mount_path: /sandbox/.cache
sub_path: cache
read_only: false
network:
tier: isolated
grants:
Expand All @@ -86,6 +110,29 @@ spec:
ref: nc-registry:5000/agent@sha256:0000000000000000000000000000000000000000000000000000000000000000
metadata:
env: NEMOCLAW_TEST_AGENT_METADATA
# The platform prepares private subdirectories; never mount the PVC root.
driverConfig:
kubernetes:
volumes:
- name: agent-data
persistent_volume_claim:
claim_name: researcher-data
read_only: false
containers:
agent:
volume_mounts:
- name: agent-data
mount_path: /sandbox/artifacts
sub_path: artifacts
read_only: false
- name: agent-data
mount_path: /sandbox/workspace
sub_path: workspace
read_only: false
- name: agent-data
mount_path: /sandbox/.cache
sub_path: cache
read_only: false
network:
tier: isolated
grants:
Expand Down
47 changes: 47 additions & 0 deletions crates/nemoclaw-e2e/cases/openshift-oidc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ spec:
user_role: nemoclaw-development-user
scopes_claim: scope
openshell.drivers.kubernetes:
allow_driver_config: true
image_pull_secrets:
- agent-registry
inferenceProviders:
Expand All @@ -66,6 +67,29 @@ spec:
ref: nc-registry:5000/agent@sha256:0000000000000000000000000000000000000000000000000000000000000000
metadata:
env: NEMOCLAW_TEST_AGENT_METADATA
# The platform prepares private subdirectories; never mount the PVC root.
driverConfig:
kubernetes:
volumes:
- name: agent-data
persistent_volume_claim:
claim_name: assistant-data
read_only: false
containers:
agent:
volume_mounts:
- name: agent-data
mount_path: /sandbox/artifacts
sub_path: artifacts
read_only: false
- name: agent-data
mount_path: /sandbox/workspace
sub_path: workspace
read_only: false
- name: agent-data
mount_path: /sandbox/.cache
sub_path: cache
read_only: false
network:
tier: isolated
grants:
Expand All @@ -83,6 +107,29 @@ spec:
ref: nc-registry:5000/agent@sha256:0000000000000000000000000000000000000000000000000000000000000000
metadata:
env: NEMOCLAW_TEST_AGENT_METADATA
# The platform prepares private subdirectories; never mount the PVC root.
driverConfig:
kubernetes:
volumes:
- name: agent-data
persistent_volume_claim:
claim_name: researcher-data
read_only: false
containers:
agent:
volume_mounts:
- name: agent-data
mount_path: /sandbox/artifacts
sub_path: artifacts
read_only: false
- name: agent-data
mount_path: /sandbox/workspace
sub_path: workspace
read_only: false
- name: agent-data
mount_path: /sandbox/.cache
sub_path: cache
read_only: false
network:
tier: isolated
grants:
Expand Down
Loading
Loading