[All Platforms][Onboard] Re-onboarding a sandbox that records direct tool disclosure fails unless --tool-disclosure is passed again
Investigation Summary
A new onboarding session stores the default tool-disclosure mode (progressive) as its seed (src/lib/onboard/session-bootstrap.ts: toolDisclosure: requested ?? DEFAULT_TOOL_DISCLOSURE). The sandbox create intent copies that seed (src/lib/onboard/machine/handlers/sandbox.ts, toolDisclosureOrDefault(session.toolDisclosure)), and src/lib/onboard/sandbox-create/orchestration.ts passes it to prepareSandboxToolDisclosure as the requested mode. resolveSandboxToolDisclosure (src/lib/tool-disclosure.ts) then compares that seed with the recorded mode of the reused sandbox and throws.
The documented and commented contract is that a reused sandbox keeps its recorded mode when no mode is selected:
docs/reference/commands.mdx, onboard--tool-disclosure: "New sandboxes default toprogressivewhen neither is set." and "To change an existing sandbox, recreate it explicitly".docs/reference/commands.mdx,NEMOCLAW_TOOL_DISCLOSURE: "A new sandbox with no recorded mode defaults toprogressive. ... Existing recorded state takes precedence."docs/reference/commands.mdx(OpenClaw variant) anddocs/configure-agents/progressive-tool-disclosure.mdx: "Existing sandbox state and explicit--tool-disclosureorNEMOCLAW_TOOL_DISCLOSUREselections take precedence."src/lib/tool-disclosure.ts: "Reusing a live sandbox must keep the behavior already baked into it." and "With no explicit request, preserve the sandbox's durable choice".
Description
Re-running onboard for an existing sandbox without --tool-disclosure fails when the sandbox records direct tool disclosure. Onboarding stops at [6/8] Creating sandbox:
Tool disclosure configuration is invalid: Error: sandbox records tool disclosure 'direct', but 'progressive' was requested; recreate the sandbox to change it
Re-run with --recreate-sandbox --tool-disclosure progressive.
It exits 1 and leaves a resumable failed session. Credential rotation by re-running onboarding with the new key in the environment therefore fails for these sandboxes. Passing --tool-disclosure direct again works around it: on the same build, onboarding then reports "Sandbox '
Affected sandboxes record direct, for example after <cli> <name> rebuild --tool-disclosure direct, or a fresh managed OpenClaw sandbox on local Ollama or vLLM, which defaults to direct.
Expected: with no --tool-disclosure or NEMOCLAW_TOOL_DISCLOSURE, onboarding reuses the sandbox and keeps its recorded mode. An explicit selection that differs from the recorded mode should still refuse with the recreate hint.
Reproduction Steps
- Onboard a sandbox non-interactively with NVIDIA Endpoints (reproduced with
--agent langchain-deepagents-code):nemoclaw onboard --non-interactive --no-gpu --agent langchain-deepagents-code --name <name>. The registry recordstoolDisclosure: progressive. nemoclaw <name> rebuild --tool-disclosure direct --yes. The registry recordstoolDisclosure: direct.- Re-run onboarding for the same sandbox with the credential in the environment and without
--tool-disclosure:NVIDIA_INFERENCE_API_KEY=<key> nemoclaw onboard --non-interactive --no-gpu --agent langchain-deepagents-code --name <name>. - Observe the
[6/8]failure above, exit 1.
Environment
OS: Ubuntu 24.04 x86_64 (Brev CPU instance)
Node.js: v22.22.2
OpenShell CLI: 0.0.116 (Docker driver)
NemoClaw: main at bdcd7869dd
Agent: LangChain Deep Agents Code v0.1.71
Provider: NVIDIA Endpoints (nvidia-prod)
Debug Output
[6/8] Creating sandbox
Tool disclosure configuration is invalid: Error: sandbox records tool disclosure 'direct', but 'progressive' was requested; recreate the sandbox to change it
Re-run with --recreate-sandbox --tool-disclosure progressive.
Onboarding did not finish. Resume from the step that failed with:
nemoclaw onboard --resume
Logs
Registry toolDisclosure stays direct after the failure, and the OpenShell sandbox is unchanged.
Checklist
- [x] I confirmed this bug is reproducible
- [x] I searched existing issues and this is not a duplicate
Could a maintainer confirm the continuation path for this fix through a branch in NVIDIA/NemoClaw, reusing the existing implementation rather than opening a competing version?
At main 7757000943e7378997822be366270957a53e4599, buildSandboxCreateIntent still supplies the session's default as the requested disclosure mode. This source observation matches the failure reported here; I have not run a new live reproduction.
The upstream branch fix/13975-tool-disclosure-reonboard remains at ede861dde9ce3e0fbe58248f3713109a183b71d0 from closed #13976. #14226 is also closed. Please preserve the existing contributors' authorship when reusing their work.
The bounded outcome is unchanged: with no explicit selection, retain the existing sandbox's recorded mode; retain explicit mismatch refusal, new-sandbox defaults and resume behavior. The existing regression and live A/B evidence in #13976 provide a starting point, not evidence for a newly rebased head.
My repository permission is READ, and the current required reviewed-SDK job rejects fork heads (trusted workflow). Is the preserved branch available for maintainer-led continuation, or is another existing PR/branch now handling it? I have not opened a new branch or duplicate PR.