Skip to content

fix(cli): use NEMOCLAW_SANDBOX_NAME as interactive prompt default#3082

Merged
ericksoa merged 3 commits into
mainfrom
fix/sandbox-name-interactive-default
May 6, 2026
Merged

fix(cli): use NEMOCLAW_SANDBOX_NAME as interactive prompt default#3082
ericksoa merged 3 commits into
mainfrom
fix/sandbox-name-interactive-default

Conversation

@jason-ma-nv

@jason-ma-nv jason-ma-nv commented May 6, 2026

Copy link
Copy Markdown
Contributor

Summary

When running nemoclaw onboard interactively, NEMOCLAW_SANDBOX_NAME was silently ignored — the sandbox name prompt always showed [my-assistant] even when the env var was exported. NEMOCLAW_ENDPOINT_URL pre-populates its prompt in the same situation. This change makes sandbox name consistent: getSandboxPromptDefault now checks the env var first, so the prompt shows the exported value as the default and pressing Enter accepts it.

Related Issue

Fixes #3060

Changes

  • src/lib/onboard.ts: getSandboxPromptDefault now reads NEMOCLAW_SANDBOX_NAME and uses it as the prompt default when set, falling back to the agent-specific hardcoded default (my-assistant / hermes)
  • src/lib/onboard.ts: updated comment near the cannotPrompt block to accurately describe when the env var is consulted
  • test/onboard.test.ts: added test confirming getSandboxPromptDefault(null) returns the env var value when NEMOCLAW_SANDBOX_NAME is set
  • test/onboard.test.ts: updated the existing hermes-defaults test assertion to reflect that NEMOCLAW_SANDBOX_NAME now takes precedence over the agent-specific default

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Verification

  • npx prek run --all-files passes
  • npm test passes
  • Tests added or updated for new or changed behavior
  • No secrets, API keys, or credentials committed
  • Docs updated for user-facing behavior changes
  • make docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: jason-ma-nv jama@nvidia.com

Summary by CodeRabbit

  • New Features

    • Sandbox default name can be set via NEMOCLAW_SANDBOX_NAME; when valid, it overrides the interactive default, otherwise falls back to the agent-based default.
  • Tests

    • Added tests for env-var override, invalid or whitespace values, and fallback behavior.

When running `nemoclaw onboard` interactively, NEMOCLAW_SANDBOX_NAME
was silently ignored — the prompt always showed [my-assistant] even
when the env var was exported. NEMOCLAW_ENDPOINT_URL pre-populates
its prompt in the same situation. This change makes sandbox name
consistent: getSandboxPromptDefault now checks the env var first,
so the prompt shows [mythos] (or whatever name is set) and pressing
Enter accepts it.

Fixes #3060

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: jason-ma-nv <jama@nvidia.com>
@jason-ma-nv jason-ma-nv self-assigned this May 6, 2026
@copy-pr-bot

copy-pr-bot Bot commented May 6, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ef251f4d-0b72-4c85-b10c-a4f6a646db94

📥 Commits

Reviewing files that changed from the base of the PR and between ce98a07 and df960c2.

📒 Files selected for processing (2)
  • src/lib/onboard.ts
  • test/onboard.test.ts

📝 Walkthrough

Walkthrough

The change updates getSandboxPromptDefault to prefer the NEMOCLAW_SANDBOX_NAME environment variable (lowercased and validated) as the interactive/default sandbox name; if invalid or unset it falls back to the existing agent-based default. Tests covering valid override, null-agent usage, invalid values, spaces, and whitespace fallback were added.

Changes

Environment Variable Priority in Sandbox Naming

Layer / File(s) Summary
Data/Validation
src/lib/onboard.ts
Reads process.env.NEMOCLAW_SANDBOX_NAME, lowercases it, and validates via validateName("sandbox name"); empty/invalid values are ignored.
Core Logic
src/lib/onboard.ts
getSandboxPromptDefault(agent) now returns the validated env-var value when present; otherwise returns agent-based default computed by getDefaultSandboxNameForAgent(agent).
Tests
test/onboard.test.ts
Updated test for Hermes to expect env-var override; added tests verifying env-var used when agent is null, invalid env-var falls back to agent default, env-var with spaces falls back, and blank/whitespace handling.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I sniffed the env and found a name,
Lowercased it neat, not chasing fame.
If it’s naughty or blank, I hop away,
Back to Hermes or my-assistant I stay.
Tests thump their feet — all set for play. 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: using NEMOCLAW_SANDBOX_NAME as the interactive prompt default, which is the primary objective of the changeset.
Linked Issues check ✅ Passed The PR fulfills the requirements of issue #3060 by modifying getSandboxPromptDefault to read NEMOCLAW_SANDBOX_NAME and use it as the interactive sandbox-name prompt default when set, with proper fallback handling.
Out of Scope Changes check ✅ Passed All changes are in scope: modifications to src/lib/onboard.ts implement the feature, and updates to test/onboard.test.ts add appropriate test coverage for the new functionality.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/sandbox-name-interactive-default

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

If NEMOCLAW_SANDBOX_NAME held an invalid value (e.g. leading digit,
spaces), getSandboxPromptDefault returned it verbatim. The prompt then
showed the invalid value as the default; pressing Enter triggered a
validateName error that surprised the user. Now falls back to the agent
default for invalid values, matching PR #3078's approach.

Also adds explicit tests for the invalid-value and space-in-name fallback
paths.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: jason-ma-nv <jama@nvidia.com>

@ericksoa ericksoa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved based on a fresh review of the updated head. The change is scoped to the sandbox prompt default, handles invalid env values by falling back to the agent default, and the current-main merge passed local build, lint, and focused onboard tests.

@ericksoa ericksoa enabled auto-merge (squash) May 6, 2026 05:18
@ericksoa ericksoa disabled auto-merge May 6, 2026 05:19
@ericksoa ericksoa merged commit 3800964 into main May 6, 2026
13 checks passed
miyoungc added a commit that referenced this pull request May 7, 2026
## Summary
- Bump docs metadata to 0.0.36 and refresh generated NemoClaw user
skills.
- Document Model Router onboarding, validation retries, Ollama tool
checks, Hermes policy behavior, and deployment verification updates.
- Remove suppressed experimental command references from public docs per
`docs/.docs-skip`.

## Source summary
- #2202 -> `docs/get-started/quickstart.md`,
`docs/inference/inference-options.md`, `docs/reference/architecture.md`:
Document Model Router setup and routed inference architecture.
- #3128 -> `docs/get-started/quickstart.md`,
`docs/reference/commands.md`: Document deployment verification and HTTP
401 health handling.
- #3104 -> `docs/inference/inference-options.md`: Document retry
behavior for transient provider validation failures.
- #3121 -> `docs/reference/architecture.md`: Document agent-scoped
model/provider compatibility manifests.
- #3046 -> `docs/reference/architecture.md`: Tie model-specific
compatibility setup to known model/provider behavior.
- #3097 -> `docs/inference/use-local-inference.md`: Document Ollama
tool-calling capability validation.
- #3082 -> `docs/reference/commands.md`: Document
`NEMOCLAW_SANDBOX_NAME` as the interactive sandbox-name default.
- f586cc5, 3442adf -> `docs/get-started/quickstart-hermes.md`,
`docs/reference/network-policies.md`: Document Hermes agent-specific
baseline policy endpoints.

## Test plan
- `python3 scripts/docs-to-skills.py docs/ .agents/skills/ --prefix
nemoclaw-user`
- `make docs`
- `npm run build:cli`
- `rg` skip-term scan for `docs/` and generated user skills

Made with [Cursor](https://cursor.com)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
  * Model Router provider for complexity-based routed inference.
* Ollama/local inference onboarding now validates tool-calling
capability.
  * Added `local-inference` network policy preset.

* **Documentation**
* New integration policy examples (Outlook, Telegram, Slack, Discord,
GitHub, Jira, etc.).
  * Clarified config immutability workflow and sandbox writable paths.
  * Hermes baseline network policy documented.

* **Improvements**
* Health checks treat device-auth responses as live; transient
validation retries.
* Installer performs pre-install reachability checks; CLI onboarding
gained a --fresh option.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@wscurran wscurran added the bug-fix PR fixes a bug or regression label Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NEMOCLAW_SANDBOX_NAME is not used in interactive mode

3 participants