From 577c1ea6a9d94993d85b23202ec8f8b21568e09f Mon Sep 17 00:00:00 2001 From: kagura-agent Date: Mon, 20 Apr 2026 09:22:04 +0800 Subject: [PATCH 1/2] fix(connect): show agent-specific command and /exit hint (Fixes #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 Signed-off-by: kagura-agent --- scripts/install.sh | 4 +++- src/nemoclaw.ts | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 64c0738baef..ec94a3c8e1c 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -260,7 +260,9 @@ print_done() { printf " %s$%s source %s\n" "$C_GREEN" "$C_RESET" "$(detect_shell_profile)" fi printf " %s$%s nemoclaw %s connect\n" "$C_GREEN" "$C_RESET" "$sandbox_name" - if [[ "$agent_name" == "openclaw" || -z "$agent_name" ]]; then + if [[ "$agent_name" == "hermes" ]]; then + printf " %ssandbox@%s$%s hermes\n" "$C_GREEN" "$sandbox_name" "$C_RESET" + else printf " %ssandbox@%s$%s openclaw tui\n" "$C_GREEN" "$sandbox_name" "$C_RESET" fi elif [[ "$NEMOCLAW_READY_NOW" == true ]]; then diff --git a/src/nemoclaw.ts b/src/nemoclaw.ts index 077ce14f654..6b7e7fa7f4f 100644 --- a/src/nemoclaw.ts +++ b/src/nemoclaw.ts @@ -1230,11 +1230,12 @@ async function sandboxConnect(sandboxName, { dangerouslySkipPermissions = false !["1", "true"].includes(String(process.env.NEMOCLAW_NO_CONNECT_HINT || "")) ) { console.log(""); + const agentCmd = sb?.agent === "hermes" ? "hermes" : "openclaw tui"; console.log(` ${G}✓${R} Connecting to sandbox '${sandboxName}'`); console.log( - ` ${D}Inside the sandbox, run \`openclaw tui\` to start chatting with the agent.${R}`, + ` ${D}Inside the sandbox, run \`${agentCmd}\` to start chatting with the agent.${R}`, ); - console.log(` ${D}Type \`exit\` (or Ctrl-D) to return to the host shell.${R}`); + console.log(` ${D}Type \`/exit\` to leave the chat, then \`exit\` to return to the host shell.${R}`); console.log(""); } const result = spawnSync(getOpenshellBinary(), ["sandbox", "connect", sandboxName], { From bf64357fc54e0a287dd2303208c63d638d1519fd Mon Sep 17 00:00:00 2001 From: kagura-agent Date: Mon, 20 Apr 2026 09:28:18 +0800 Subject: [PATCH 2/2] refactor: generalize agent command mapping for non-Hermes agents 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 Signed-off-by: kagura-agent --- scripts/install.sh | 18 +++++++++++++----- src/nemoclaw.ts | 3 ++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index ec94a3c8e1c..83dc7cacb77 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -260,11 +260,19 @@ print_done() { printf " %s$%s source %s\n" "$C_GREEN" "$C_RESET" "$(detect_shell_profile)" fi printf " %s$%s nemoclaw %s connect\n" "$C_GREEN" "$C_RESET" "$sandbox_name" - if [[ "$agent_name" == "hermes" ]]; then - printf " %ssandbox@%s$%s hermes\n" "$C_GREEN" "$sandbox_name" "$C_RESET" - else - printf " %ssandbox@%s$%s openclaw tui\n" "$C_GREEN" "$sandbox_name" "$C_RESET" - fi + local agent_cmd + case "$agent_name" in + hermes) + agent_cmd="hermes" + ;; + "" | openclaw) + agent_cmd="openclaw tui" + ;; + *) + agent_cmd="$agent_name" + ;; + esac + printf " %ssandbox@%s$%s %s\n" "$C_GREEN" "$sandbox_name" "$C_RESET" "$agent_cmd" elif [[ "$NEMOCLAW_READY_NOW" == true ]]; then printf " ${C_GREEN}NemoClaw CLI is installed.${C_RESET}\n" printf " ${C_DIM}Onboarding has not run yet.${C_RESET}\n" diff --git a/src/nemoclaw.ts b/src/nemoclaw.ts index 6b7e7fa7f4f..0d9d5ce8bb2 100644 --- a/src/nemoclaw.ts +++ b/src/nemoclaw.ts @@ -1230,7 +1230,8 @@ async function sandboxConnect(sandboxName, { dangerouslySkipPermissions = false !["1", "true"].includes(String(process.env.NEMOCLAW_NO_CONNECT_HINT || "")) ) { console.log(""); - const agentCmd = sb?.agent === "hermes" ? "hermes" : "openclaw tui"; + const agentName = sb?.agent || "openclaw"; + const agentCmd = agentName === "openclaw" ? "openclaw tui" : agentName; console.log(` ${G}✓${R} Connecting to sandbox '${sandboxName}'`); console.log( ` ${D}Inside the sandbox, run \`${agentCmd}\` to start chatting with the agent.${R}`,