fix(connect): show agent-specific command and /exit hint (Fixes #2079)#2080
Conversation
…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]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughPost-connection hints were made agent-aware: the suggested in-sandbox command now reflects the sandbox's configured agent (e.g., Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (2)
scripts/install.shsrc/nemoclaw.ts
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]>
|
✨ 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: |
ericksoa
left a comment
There was a problem hiding this comment.
Reviewed: small, well-scoped UX fix. Logic is consistent between TS and shell implementations, properly derives agent-specific commands, and improves exit instructions. LGTM.
## 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]>
Summary
Fixes #2079 — the connect hint showed incorrect instructions after connecting to a sandbox.
Problems
openclaw tuiregardless of which agent the sandbox runs. For hermes sandboxes, the correct command ishermes.exit(shell exit), but users who launched the TUI first need/exitto leave the chat beforeexitreturns them to the host shell.Changes
src/nemoclaw.ts: Derive the TUI command from the sandbox registry'sagentfield (hermes→hermes, others →openclaw tui). Updated exit hint to mention/exitfor 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
NEMOCLAW_NO_CONNECT_HINT=1)Signed-off-by: kagura-agent [email protected]
Summary by CodeRabbit
Bug Fixes
Documentation