fix(sandbox): name the sandbox in in-sandbox host-side hints - #7870
Conversation
The in-sandbox hints that print a copyable host-side `nemoclaw <name> …` command resolved the sandbox name from OPENSHELL_SANDBOX at render time. OpenShell records the name on the container but exports the variable as the boolean "1" to every process it spawns inside the sandbox — the entrypoint and the `connect` shell included — keeping the real value only in its own root-owned PID 1 environment, which the unprivileged entrypoint cannot read. The name was therefore unavailable in-sandbox and both hints always rendered the literal `<name>` placeholder, so the copyable command could not be used or scripted. Inject the host's already-validated sandbox name as NEMOCLAW_SANDBOX_NAME for every sandbox at create time — it was previously injected for the deepagents image only — and have the entrypoint bake it into the generated connect-shell env for the renderer to fall back to. OPENSHELL_SANDBOX is still preferred when it carries a usable name, so the documented OpenShell >= 0.0.44 contract is unchanged. The baked value is allowlisted at both the bake and the render site, so only an RFC-1123 sandbox name can reach the command, and the operation/channel token allowlists are untouched. This also repairs the policy-denial logs breadcrumb, which shares the same renderer and was equally affected in connect shells. Fixes #7795 Signed-off-by: Yanyun Liao <yanyunl@nvidia.com>
The codebase-growth-guardrails job requires changed test files not to add if statements. Build the generator environment with a spread instead, which keeps the "host injected no name" case explicit without branching. Signed-off-by: Yanyun Liao <yanyunl@nvidia.com>
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughSandbox names now propagate to runtime environments. Connect-shell generation validates and stores a sandbox label. Policy-denial hints use the runtime name, the stored label, or ChangesSandbox label flow
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant SandboxCreation
participant ConnectShellEnvironment
participant PolicyDenialHint
SandboxCreation->>ConnectShellEnvironment: Inject NEMOCLAW_SANDBOX_NAME
ConnectShellEnvironment->>ConnectShellEnvironment: Validate and export _NEMOCLAW_SANDBOX_LABEL
ConnectShellEnvironment->>PolicyDenialHint: Provide runtime and baked label sources
PolicyDenialHint->>PolicyDenialHint: Select valid name or <name> fallback
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in commit ff1a078 in the TypeScript / code-coverage/cliThe overall coverage in commit ff1a078 in the Show a code coverage summary of the most impacted files.
Updated |
|
🌿 Preview your docs: https://nvidia-preview-pr-7870.docs.buildwithfern.com/nemoclaw |
PR Review Advisor — No blocking findings reportedAdvisor assessment: No blocking advisor findings reported Model lanes
2 additional E2E selections from the second opinionAdvisory only. The primary lane did not select these E2E jobs or targets.
Second-opinion E2E selections are advisory. They do not change the primary assessment or E2E / PR Gate. E2E guidanceAdvisory only. E2E / PR Gate selects and runs jobs independently. Recommended E2E: 1 optional E2E recommendation
This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
cjagwani
left a comment
There was a problem hiding this comment.
Exact-head review complete. Deterministic maintainer gate passes with all 55 current checks green, verified history, clean mergeability, and no unresolved major findings. The focused regression suite passes 39 of 39 locally. Security review PASS: secrets, input validation, authentication and authorization, dependencies, error handling and logging, cryptography and data protection, configuration, security testing, and system security. The sandbox name is allowlisted before baking and revalidated after sandbox-controlled mutation; invalid or absent values fail closed to the placeholder. The duplicate note is obsolete because closed PR #7802 was explicitly superseded by this fresh compliant branch.
|
Current-base handoff after main advanced to da1b103: exact head 3e0bfb1 remains approved with focused tests and a PASS security review, but maintainer edits are disabled and current-base evidence must be regenerated. Please refresh it; I will re-gate the next quiet head. This is a plain status comment, not Changes Requested. |
|
Correction to my prior handoff: conflict-free base refreshes are explicitly waived. Please do not merge main solely for base currency; preserving exact-head CI/E2E and documentation receipts is preferred unless GitHub reports a real conflict or reviewed behavior requires a change. The existing approval/review evidence remains in force, and I will continue monitoring mergeability. This is a plain coordination comment, not Changes Requested. |
<!-- markdownlint-disable MD041 --> ## Summary Adds the canonical dated `v0.0.101` changelog entry that was missing when the release tag was cut. This post-release recovery records the shipped behavior on current `main` without changing or replacing the existing tag. ## Changes - Add `docs/changelog/2026-08-03.mdx` with the exact `## v0.0.101` heading, release summary, detailed behavior changes, support boundaries, and links to durable documentation. - [#7317](#7317) -> `docs/changelog/2026-08-03.mdx`: Records experimental OpenClaw Google Chat support and its restricted credential and webhook boundary. - [#7715](#7715) -> `docs/changelog/2026-08-03.mdx`: Records strict onboarding recovery state and authoritative resume identity. - [#7749](#7749) -> `docs/changelog/2026-08-03.mdx`: Records the provider-neutral policy seam and unchanged runtime support boundary. - [#7817](#7817) -> `docs/changelog/2026-08-03.mdx`: Records preserved Hermes home-channel assignments across rebuilds. - [#7820](#7820) -> `docs/changelog/2026-08-03.mdx`: Records the SSH-session status field correction. - [#7847](#7847) -> `docs/changelog/2026-08-03.mdx`: Records fail-closed credential filtering for migration and rebuild backups. - [#7870](#7870) -> `docs/changelog/2026-08-03.mdx`: Records sandbox-qualified in-sandbox host command hints. - [#7875](#7875) -> `docs/changelog/2026-08-03.mdx`: Records Microsoft Teams stop and start E2E coverage. - [#7885](#7885) -> `docs/changelog/2026-08-03.mdx`: Records Hermes managed gateway detection in status. - [#7889](#7889) -> `docs/changelog/2026-08-03.mdx`: Records policy-authenticated HTTPS Pin Runtime route revocation. - [#7891](#7891) -> `docs/changelog/2026-08-03.mdx`: Records default fallback for negative timeout and polling overrides. - [#7993](#7993) -> `docs/changelog/2026-08-03.mdx`: Records correct sibling detection during uninstall. - [#7995](#7995) -> `docs/changelog/2026-08-03.mdx`: Records absent configuration-hash handling before shields lock. - [#8001](#8001) -> `docs/changelog/2026-08-03.mdx`: Records the dormant atomic managed workload replacement foundation. - [#8029](#8029) -> `docs/changelog/2026-08-03.mdx`: Records repository terminology review in PR Review Advisor. - [#8031](#8031) -> `docs/changelog/2026-08-03.mdx`: Records provider-neutral managed snapshot authority. - [#8032](#8032) -> `docs/changelog/2026-08-03.mdx`: Records immutable managed clone handoff contracts. - [#8034](#8034) -> `docs/changelog/2026-08-03.mdx`: Records the dormant provider-owned clone transaction surface. - [#8035](#8035) -> `docs/changelog/2026-08-03.mdx`: Records the dormant Hermes managed clone broker boundary. - [#8036](#8036) -> `docs/changelog/2026-08-03.mdx`: Records the dormant transactional managed bootstrap boundary. - [#8037](#8037) -> `docs/changelog/2026-08-03.mdx`: Records dormant Docker bootstrap primitives and the unchanged provider support boundary. - [#8070](#8070) -> `docs/changelog/2026-08-03.mdx`: Records consolidated sandbox resource-limit E2E coverage. - [#8071](#8071) -> `docs/changelog/2026-08-03.mdx`: Records escaped and bounded CLI validation diagnostics. - [#8081](#8081) -> `docs/changelog/2026-08-03.mdx`: Records bounded linear snapshot Base64 validation. - [#8085](#8085) -> `docs/changelog/2026-08-03.mdx`: Records commit-bound workflow approval for eligible same-repository maintainers. - [#8088](#8088) -> `docs/changelog/2026-08-03.mdx`: Records Hermes managed-policy E2E selection. - [#8090](#8090) -> `docs/changelog/2026-08-03.mdx`: Records pinned CI search-tool provisioning. - [#8106](#8106) -> `docs/changelog/2026-08-03.mdx`: Records fallback from failed managed OpenShell gateway startup. - [#8107](#8107) -> `docs/changelog/2026-08-03.mdx`: Records Hermes adapter lifecycle E2E selection. - [#8128](#8128) -> `docs/changelog/2026-08-03.mdx`: Records the dormant transactional Docker bootstrap adapter and rollback authority. - [#8140](#8140) -> `docs/changelog/2026-08-03.mdx`: Records Slack conflict scope across independent OpenShell gateways. - [#8147](#8147) -> `docs/changelog/2026-08-03.mdx`: Records completion of durable v0.0.100 documentation audit follow-ups. ## Type of Change - [ ] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [x] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [ ] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [x] Tests not applicable — justification: This documentation-only recovery does not change executable behavior. - [x] Docs updated for user-facing behavior changes - [ ] Docs not applicable — justification: - [ ] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [ ] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Documentation Writer Review - [x] Documentation writer subagent reviewed the completed changes - Result: `docs-updated` - Evidence: Independently reviewed `docs/changelog/2026-08-03.mdx` at commit `0bebe1f568e3dc85cf410aac1dfb8f8830070b85`. Its blob is `82887920f9720eafd75db6b2271c35f7477edb9b`. The entry follows the writing guide, controlled terminology, changelog structure, MDX SPDX format, literal CLI-name rule, and root-absolute route requirements. It accurately records the `v0.0.100...v0.0.101` release range, Announcement #8162, accepted scope boundaries, and shipped security behavior. There are no code samples. Focused changelog tests and the documentation build pass for this commit. - Agent: Codex Desktop independent documentation writer <!-- docs-review-head-sha: 0bebe1f --> <!-- docs-review-agents-blob-sha: 3dd7c24 --> ## Security Review - Result: `PASS` - Reviewed commit: `0bebe1f568e3dc85cf410aac1dfb8f8830070b85` - Base commit: `643a4ab8b5f583d8555192a37927268b26022c51` - Findings: None. - Secrets and credentials: `PASS`. No credential values or secret files are present. - Input validation and data sanitization: `PASS`. No executable input path changes. - Authentication and authorization: `PASS`. No identity or permission logic changes. - Dependencies and third-party libraries: `PASS`. No dependency changes. - Error handling and logging: `PASS`. No runtime path changes; diagnostic-security claims are precise. - Cryptography and data protection: `PASS`. No implementation changes. - Configuration and security controls: `PASS`. No configuration, container, port, or HTTP changes. - Security testing: `PASS`. No coverage is removed; the entry records shipped test and security behavior. - System security: `PASS`. No runtime control changes; dormant and non-activation boundaries are explicit. - Agent: Codex Desktop independent security reviewer ## Verification - [ ] PR description includes a `Signed-off-by:` line and every commit appears as `Verified` in GitHub — verification is pending after commit `0bebe1f568e3dc85cf410aac1dfb8f8830070b85` is pushed. - [ ] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or `npm run validate:pr` passed after refreshing `origin/main` when hooks were skipped or unavailable — commit hooks passed; pre-push is pending. - [x] Targeted behavior tests pass for the current change set, or tests are marked not applicable above — tests are not applicable to this documentation-only recovery. - [x] Applicable broad gate passed — not applicable to this documentation-only recovery. - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, credentials, or private keys are added by this diff. - [ ] `npm run docs` builds without warnings (doc changes only) — GitHub documentation checks are pending. - [x] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) — independent documentation review passed. - [x] New doc pages include SPDX header and frontmatter (new pages only) — the native changelog entry uses the required parser-safe MDX SPDX comment and intentionally has no frontmatter. GitHub CI is authoritative. Focused changelog tests and `npm run docs` passed after the merge refresh. --- Signed-off-by: Apurv Kumaria <akumaria@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added experimental Google Chat support. * Improved runtime and session status visibility. * Added onboarding recovery and persistence safeguards. * Added snapshot validation and dormant managed-workload support. * **Bug Fixes** * Improved backup sanitization, route handling, and gateway reliability. * **Documentation** * Added the v0.0.101 changelog and related updates. * **Tests** * Expanded end-to-end coverage and strengthened trusted CI validation. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Apurv Kumaria <akumaria@nvidia.com> Signed-off-by: Carlos Villela <cvillela@nvidia.com> Co-authored-by: Carlos Villela <cvillela@nvidia.com> Co-authored-by: Senthil Ravichandran <senthilr@nvidia.com>
Summary
Inside a sandbox, every hint that prints a copyable host-side
nemoclaw <name> …command rendered the literal<name>placeholder instead of the sandbox name, so the command could not be copied or scripted. Inject the host's validated sandbox name into every sandbox and resolve the hints from it.Closes #7795.
Reproduction
Executed on our DGX Spark aarch64 test host (GB10 GPU), against a sandbox freshly onboarded from
mainateeab81cc5:node bin/nemoclaw.js onboard --name repro-7795 --non-interactive --yesnode bin/nemoclaw.js repro-7795 connect(driven through a real PTY, notexec)openclaw channels add discordEnvironment
main@eeab81cc5542902538c97db63c132c0fdbd4341c(v0.0.96-45-geeab81cc5)repro-7795, agentopenclaw, providerollama-localObserved on
main(before fix)MARKER_ENVisecho $OPENSHELL_SANDBOXin the connect shell.Observed on
fix/…(after fix)The last line is
openclaw channels add "$(cat /etc/shadow)": the channel token still degrades to<channel>and no file content reaches the command, so the existing token allowlists are unaffected.Analysis
_nemoclaw_policy_denial_hint_label()inscripts/nemoclaw-start.shresolved the name fromOPENSHELL_SANDBOX, documented there as carrying the sandbox name on OpenShell >= 0.0.44.That assumption does not hold for any process inside the sandbox. OpenShell records
OPENSHELL_SANDBOX=<name>on the container, but the sandbox supervisor (PID 1) spawns sandbox processes with a rebuilt environment in which the variable is the boolean1. Measured on the test host:OPENSHELL_SANDBOX=repro-7795nemoclaw-startentrypoint (runs as the unprivilegedsandboxuser):OPENSHELL_SANDBOX=1, and none of the otherOPENSHELL_*values are presentconnectshell:OPENSHELL_SANDBOX=1The real value survives only in PID 1's environment, which is root-owned; the entrypoint runs as
sandboxand getsEACCESon/proc/1/environ. The container hostname is the container ID, and no other in-container source carries the name. So the name was genuinely unavailable in-sandbox, and the allowlist correctly rejected1, falling back to the placeholder at every call site.This affected both consumers of the helper — the
openclaw channels add/removeguard hint (scripts/nemoclaw-start.sh:3774, added in #7295) and the policy-denial logs breadcrumb (scripts/nemoclaw-start.sh:3912, added in #5978). Their unit tests pass only because they setOPENSHELL_SANDBOXto a name directly, which never happens in a real connect shell.The troubleshooting docs attributed real-name rendering to OpenShell 0.0.44 or newer. The reproduction on OpenShell 0.0.85 disproved that version distinction, so this PR updates both the implementation and the troubleshooting text.
Fix
buildSandboxRuntimeEnvArgs()already injectedNEMOCLAW_SANDBOX_NAMEinto the sandbox startup command, but only for LangChain Deep Agents Code. Hoist that injection so every sandbox receives it. The value is the host's ownsandboxName, already validated byNAME_VALID_PATTERNbefore a sandbox is created, andNEMOCLAW_SANDBOX_NAMEis an existing documented NemoClaw variable with exactly this meaning — no new contract is introduced.write_runtime_shell_env()then bakes that name into the generated connect-shell env as_NEMOCLAW_SANDBOX_LABEL, and the renderer falls back to it whenOPENSHELL_SANDBOXis unusable.Security properties:
/^[a-z]([a-z0-9-]*[a-z0-9])?$/, max 63), evaluated underLC_ALL=Cin a subshell. Re-checking at render time matters because the sandbox can reassign the variable after the file is sourced.export _NEMOCLAW_SANDBOX_LABEL='<name>'orunset _NEMOCLAW_SANDBOX_LABEL, never nothing, so a value pre-set by the sandbox cannot survive into a copyable command when no valid name is available.OPENSHELL_SANDBOXkeeps priority when it carries a usable name, so a caller-provided valid runtime name overrides the generated fallback.<name>placeholder, so the failure mode is unchanged.Scope note: the remaining literal
nemoclaw <sandbox> …strings in this file (thechannels loginguidance, the rebuild /channels status/shields downmessages) are generic instructional text that does not echo a specific user invocation, matching the repo-wide documentation convention. #7295 deliberately replaced only the add/remove branch, so they are left as-is.Tests added:
test/repro-7795-connect-shell-sandbox-label.test.tsruns the realwrite_runtime_shell_envgenerator under the environment the entrypoint actually receives, then sources its output in a shell withOPENSHELL_SANDBOX=1— the connect-shell condition — and asserts the rendered hints. It covers both consumers, runtime-name precedence, boolean/empty/absent inputs, seven invalid inputs (including shell metacharacters, an ANSI escape with a newline, and command substitution), the 63-character limit, a sandbox-set label, a pre-set label that must be unset, and agreement withNAME_VALID_PATTERN.src/lib/onboard/sandbox-create-launch.test.tspins that every agent receivesNEMOCLAW_SANDBOX_NAME, and that it is omitted when no name is known.Both would have failed before this change: the generator emitted no label, so the connect-shell assertions rendered
<name>.Changes
src/lib/onboard/sandbox-create-launch.ts: injectNEMOCLAW_SANDBOX_NAMEfor every agent instead of LangChain Deep Agents Code only.scripts/nemoclaw-start.sh: bake the validated name into the connect-shell env, and resolve the hint label from it whenOPENSHELL_SANDBOXis unusable.src/lib/onboard/sandbox-create-launch.test.ts: coverage for the injection.test/repro-7795-connect-shell-sandbox-label.test.ts: end-to-end connect-shell regression coverage.docs/reference/troubleshooting.mdx: describe the NemoClaw fallback without the incorrect OpenShell version distinction.Type of Change
Quality Gates
Documentation Writer Review
docs-updateddocs/reference/troubleshooting.mdxto describe the NemoClaw-provided name without the incorrect OpenShell version distinction.Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run check:diffpassed when hooks were skipped or unavailablenpx vitest run --project cli --project integration src/lib/onboard/sandbox-create-launch.test.ts test/repro-7795-connect-shell-sandbox-label.test.tspasses 39 tests on Bash 3.2.57.npm testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changes — command/result:npm run docsbuilds without warnings (doc changes only) — the docs build passes with 0 errors and 2 existing Fern warnings.Verified end to end on aarch64. The reporter notes the issue is not believed platform-specific, and the mechanism is connect-shell environment behavior rather than architecture, but an x86_64 confirmation before merge would close that gap.
AI Disclosure
Signed-off-by: Yanyun Liao yanyunl@nvidia.com
Signed-off-by: Prekshi Vyas prekshiv@nvidia.com
Summary by CodeRabbit
Bug Fixes
<name>fallback otherwise.Documentation
nemoclaw listfallback.Co-authored-by: Prekshi Vyas prekshiv@nvidia.com