Skip to content

fix(connect): show agent-specific command and /exit hint (Fixes #2079)#2080

Merged
ericksoa merged 2 commits intoNVIDIA:mainfrom
kagura-agent:fix/connect-hint-instructions
Apr 21, 2026
Merged

fix(connect): show agent-specific command and /exit hint (Fixes #2079)#2080
ericksoa merged 2 commits intoNVIDIA:mainfrom
kagura-agent:fix/connect-hint-instructions

Conversation

@kagura-agent
Copy link
Copy Markdown
Contributor

@kagura-agent kagura-agent commented Apr 20, 2026

Summary

Fixes #2079 — the connect hint showed incorrect instructions after connecting to a sandbox.

Problems

  1. Wrong TUI command: Always showed openclaw tui regardless of which agent the sandbox runs. For hermes sandboxes, the correct command is hermes.
  2. Missing /exit hint: The exit hint only mentioned exit (shell exit), but users who launched the TUI first need /exit to leave the chat before exit returns them to the host shell.

Changes

  • src/nemoclaw.ts: Derive the TUI command from the sandbox registry's agent field (hermeshermes, others → openclaw tui). Updated exit hint to mention /exit for leaving the chat.
  • scripts/install.sh: Show agent-specific command in post-onboard hint (was only shown for openclaw agent, now shown for all agents with correct command).

Testing

  • Ran full test suite — 0 new failures (38 pre-existing failures unchanged)
  • No test assertions reference the hint text (tests suppress via NEMOCLAW_NO_CONNECT_HINT=1)

Signed-off-by: kagura-agent [email protected]

Summary by CodeRabbit

  • Bug Fixes

    • Sandbox connection hint now always shows a single connect command reflecting the configured agent (Hermes, OpenClaw tui, or the agent's name).
  • Documentation

    • Clarified exit instructions: use "/exit" to leave the in-sandbox chat, then "exit" to return to the host shell.

…A#2079)

The connect hint always showed `openclaw tui` regardless of which
agent the sandbox runs. For hermes sandboxes the correct command is
`hermes`.

Additionally, the exit hint only mentioned `exit` (shell exit) but
users who launched the TUI first need `/exit` to leave the chat
before `exit` will return them to the host shell.

Changes:
- Derive the TUI command from the sandbox registry agent field
- Update exit hint to mention `/exit` for leaving the chat
- Show correct command in install.sh post-onboard hint

Signed-off-by: kagura-agent <[email protected]>
Signed-off-by: kagura-agent <[email protected]>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 12647975-c7c0-4558-ac63-c4ea6b0d3fe1

📥 Commits

Reviewing files that changed from the base of the PR and between 577c1ea and bf64357.

📒 Files selected for processing (2)
  • scripts/install.sh
  • src/nemoclaw.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • scripts/install.sh
  • src/nemoclaw.ts

📝 Walkthrough

Walkthrough

Post-connection hints were made agent-aware: the suggested in-sandbox command now reflects the sandbox's configured agent (e.g., hermes or openclaw tui) and the exit guidance was changed to instruct /exit to leave the chat, then exit to return to the host shell.

Changes

Cohort / File(s) Summary
Agent-specific connection & exit hints
scripts/install.sh, src/nemoclaw.ts
Compute and print the in-sandbox agent command from the sandbox agent setting (prints hermes for hermes, openclaw tui for openclaw, or the raw agent name otherwise). Update exit guidance to: "Type /exit to leave the chat, then exit to return to the host shell."

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

A rabbit peeks in, polite and spry,
"Run hermes now," it whispers sly.
When chat is done, don't quit in haste—
/exit then exit, no trace misplaced. 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.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 title clearly and concisely summarizes the main changes: fixing the connect hint to show the correct agent-specific command and the /exit instruction.
Linked Issues check ✅ Passed The code changes directly address both objectives from issue #2079: showing agent-specific commands (hermes instead of openclaw tui) and clarifying the /exit hint for leaving the chat.
Out of Scope Changes check ✅ Passed All changes are directly related to the objectives in issue #2079; no out-of-scope modifications were introduced.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/install.sh`:
- Around line 263-267: The printf branch currently only handles agent_name ==
"hermes" and else prints "openclaw tui" for all other agents, which gives
incorrect post-install command hints; update the conditional logic in the
install.sh section handling agent_name (the if checking "hermes" and the else
printf lines) to cover other known agents or default to a generic command hint:
add explicit branches for additional agent names you support (e.g., "openclaw",
"otherAgentName") each printing the correct sandbox command, and change the
fallback printf to a generic message that includes the actual agent_name
variable (e.g., "sandbox@%s$ %s") so unknown values show the agent_name rather
than always "openclaw tui".

In `@src/nemoclaw.ts`:
- Around line 1233-1238: The hint hardcodes "openclaw tui" for all non-Hermes
agents; change agentCmd construction to derive the CLI from sb?.agent so it
correctly reflects other agent names. Specifically, update the agentCmd logic
(variable name agentCmd and the expression using sb?.agent) to: use "hermes"
when sb?.agent === "hermes", otherwise if sb?.agent is present use `${sb.agent}
tui` (so the hint shows e.g. "otherAgent tui"), and finally fallback to
"openclaw tui" only when sb?.agent is missing/undefined; ensure the rest of the
console.log lines continue to use agentCmd.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: af1988ad-4f3c-49eb-b710-0dad5a88ad0c

📥 Commits

Reviewing files that changed from the base of the PR and between 2a29b5e and 577c1ea.

📒 Files selected for processing (2)
  • scripts/install.sh
  • src/nemoclaw.ts

Comment thread scripts/install.sh Outdated
Comment thread src/nemoclaw.ts Outdated
Use agent name from registry to derive the correct command for any
agent, not just hermes/openclaw. Falls back to 'openclaw tui' when
the agent field is empty or 'openclaw'.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: kagura-agent <[email protected]>
Signed-off-by: kagura-agent <[email protected]>
@wscurran wscurran added NemoClaw CLI Use this label to identify issues with the NemoClaw command-line interface (CLI). fix labels Apr 20, 2026
@wscurran
Copy link
Copy Markdown
Contributor

✨ Thanks for submitting this pull request that proposes a fix to the connect hint and adds a new exit hint, which could help improve the user experience of NemoClaw.


Possibly related open issues:

Copy link
Copy Markdown
Contributor

@ericksoa ericksoa left a comment

Choose a reason for hiding this comment

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

Reviewed: small, well-scoped UX fix. Logic is consistent between TS and shell implementations, properly derives agent-specific commands, and improves exit instructions. LGTM.

@ericksoa ericksoa merged commit 77fc4c9 into NVIDIA:main Apr 21, 2026
1 check passed
@cv cv added the v0.0.22 Release target label Apr 21, 2026
@miyoungc miyoungc mentioned this pull request Apr 22, 2026
13 tasks
miyoungc added a commit that referenced this pull request Apr 22, 2026
## Summary

Bumps the published doc version to `0.0.22` and documents the
user-visible CLI behavior changes to `nemoclaw <name> connect` that
landed since v0.0.21. Drafted via the `nemoclaw-contributor-update-docs`
skill against commits in `v0.0.21..origin/main`, filtered through
`docs/.docs-skip`.

## Changes

- **`docs/project.json`** and **`docs/versions1.json`**: bump the
published version from `0.0.20` to `0.0.22`; insert a `0.0.21` entry
into the version list so the history stays contiguous.
- **`docs/reference/commands.md`** → `nemoclaw <name> connect`: document
two new behaviors.
- Readiness poll with `NEMOCLAW_CONNECT_TIMEOUT` (integer seconds;
default `120`) that replaces the silent hang when the sandbox is not yet
`Ready` — right after onboarding, while the 2.4 GB image is still
pulling (#466).
- Post-connect hint is now agent-aware, names the correct TUI command
for the sandbox's agent, and tells you to use `/exit` to leave the chat
before `exit` returns you to the host shell (#2080).

Feature PRs that shipped their own docs in the same commit are
intentionally not re-documented here:

- `channels list/add/remove` (#2139) — command reference and the
"`openclaw channels` blocked inside the sandbox" troubleshooting entry
landed with the feature.
- `nemoclaw gc` (#2176) — documented as part of the destroy/rebuild
image cleanup PR.

Skipped per `docs/.docs-skip`:

- `e6bad533 fix(shields): verify config lock and fail hard on re-lock
failure (#2066)` — matched `skip-features: src/lib/shields.ts`.

Other commits in the range (#2141 OpenShell version bump, #1819 plugin
banner live inference probe, #2085 / #2146 Slack Socket Mode fixes,
#2110 axios proxy fix, #1818 NIM curl timeouts, #1824 onboard gateway
bootstrap recovery, and assorted CI / test / install plumbing) are
internal behavior refinements with no doc-relevant surface change.

## Type of Change

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

## Verification

- [x] `npx prek run --all-files` passes for the modified files via the
pre-commit hook, including `Regenerate agent skills from docs` (source ↔
generated parity confirmed)
- [ ] `npm test` passes — skipped; the one pre-existing
`test/cli.test.ts > unknown command exits 1` failure on `origin/main` is
unrelated to these markdown/JSON-only changes
- [ ] Tests added or updated for new or changed behavior — n/a, doc-only
- [x] No secrets, API keys, or credentials committed
- [x] Docs updated for user-facing behavior changes
- [ ] `make docs` builds without warnings (doc changes only) — not run
locally
- [x] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)
— n/a, no new pages

## AI Disclosure

- [x] AI-assisted — tool: Claude Code

---
Signed-off-by: Miyoung Choi <[email protected]>

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

* **New Features**
* `connect` now displays the sandbox phase while waiting for readiness
and honors a configurable timeout via NEMOCLAW_CONNECT_TIMEOUT (default
120s).
* TTY hints are agent-aware and instruct using `/exit` before returning
to the host shell.

* **Documentation**
  * Command docs updated to describe polling, timeout, and TTY guidance.
* Project/docs metadata updated for versions 0.0.21 and 0.0.22 (package
version bumped to 0.0.22).
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix NemoClaw CLI Use this label to identify issues with the NemoClaw command-line interface (CLI). v0.0.22 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong instructions after connection established to hermes sandboxes

4 participants