From 272f0d117b65275a0c687015035a8a14740613c0 Mon Sep 17 00:00:00 2001 From: Rithull Raj Kallat Date: Sat, 7 Nov 2026 13:15:22 +0530 Subject: [PATCH] fix(cli): restore agent-aware command hints in connect and onboarding (Fixes #14076) Signed-off-by: Rithull Raj Kallat --- src/lib/actions/sandbox/connect-flow.test.ts | 3 +-- src/lib/actions/sandbox/connect.ts | 9 +++++++-- src/lib/onboard/dashboard.ts | 9 +++++++-- test/onboarding/onboard-dashboard.test.ts | 8 ++++---- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/lib/actions/sandbox/connect-flow.test.ts b/src/lib/actions/sandbox/connect-flow.test.ts index 834e8746d12..d34a2596274 100644 --- a/src/lib/actions/sandbox/connect-flow.test.ts +++ b/src/lib/actions/sandbox/connect-flow.test.ts @@ -271,8 +271,7 @@ describe("connectSandbox flow", () => { await expect(harness.connectSandbox("alpha")).rejects.toThrow("process.exit(0)"); const output = harness.logSpy.mock.calls.map((call) => String(call[0])).join("\n"); - expect(output).toContain("Inside the sandbox, run the configured command to start chatting."); - expect(output).not.toContain("dcode"); + expect(output).toContain("Inside the sandbox, run dcode to start chatting."); expect(output).not.toContain("langchain-deepagents-code"); expect(exitSpy).toHaveBeenCalledWith(0); }); diff --git a/src/lib/actions/sandbox/connect.ts b/src/lib/actions/sandbox/connect.ts index d13a95c6fc4..bbce7e83213 100644 --- a/src/lib/actions/sandbox/connect.ts +++ b/src/lib/actions/sandbox/connect.ts @@ -3246,9 +3246,14 @@ async function prepareConnectSandboxWithinLifecycleFence( console.log(""); // Same resolver `launch` uses, so the hint cannot drift from the command // that `nemoclaw launch ` actually runs (#6006). - void agentRuntime.getInteractiveAgentCommand(agent, sb?.agent); + let agentCommand = "openclaw tui"; + try { + agentCommand = agentRuntime.getInteractiveAgentCommand(agent, sb?.agent) || "openclaw tui"; + } catch { + agentCommand = "openclaw tui"; + } console.log(` ${G}✓${R} Connecting to sandbox '${sandboxName}'`); - console.log(` ${D}Inside the sandbox, run the configured command to start chatting.${R}`); + console.log(` ${D}Inside the sandbox, run ${agentCommand} to start chatting.${R}`); console.log( ` ${D}Type \`/exit\` to leave the chat, then \`exit\` to return to the host shell.${R}`, ); diff --git a/src/lib/onboard/dashboard.ts b/src/lib/onboard/dashboard.ts index 871bab77f27..80e21a8ddb2 100644 --- a/src/lib/onboard/dashboard.ts +++ b/src/lib/onboard/dashboard.ts @@ -779,8 +779,13 @@ export function createOnboardDashboardHelpers(deps: OnboardDashboardDeps): Onboa console.log(""); console.log(`${indent} Or open a sandbox shell first:`); console.log(`${indent} ${deps.cliName()} ${sandboxName} connect`); - void getInteractiveAgentCommand(agent, agent?.name); - console.log(`${indent} then run the configured interactive agent command`); + let agentCommand = "openclaw tui"; + try { + agentCommand = getInteractiveAgentCommand(agent, agent?.name) || "openclaw tui"; + } catch { + agentCommand = "openclaw tui"; + } + console.log(`${indent} then run: ${agentCommand}`); } async function printDashboard( diff --git a/test/onboarding/onboard-dashboard.test.ts b/test/onboarding/onboard-dashboard.test.ts index 159fa5c04de..5647feead31 100644 --- a/test/onboarding/onboard-dashboard.test.ts +++ b/test/onboarding/onboard-dashboard.test.ts @@ -557,7 +557,7 @@ describe("onboard dashboard helpers", () => { expect(output).toMatch(/Browser:\n\s+https?:\/\/\S+/); expect(output).not.toContain("#token="); expect(output).not.toContain("dashboard-url --quiet"); - expect(output).toContain("then run the configured interactive agent command"); + expect(output).toContain("then run: openclaw tui"); }); it("offers launch first and keeps connect in the OpenClaw ready summary (#6006)", async () => { @@ -573,7 +573,7 @@ describe("onboard dashboard helpers", () => { "", " Or open a sandbox shell first:", " nemoclaw my-gpt-claw connect", - " then run the configured interactive agent command", + " then run: openclaw tui", ].join("\n"), ); expect(output.indexOf("nemoclaw launch my-gpt-claw")).toBeLessThan( @@ -594,7 +594,7 @@ describe("onboard dashboard helpers", () => { "", " Or open a sandbox shell first:", " nemohermes my-hermes connect", - " then run the configured interactive agent command", + " then run: hermes", ].join("\n"), ); expect(output).not.toContain("openclaw tui"); @@ -613,7 +613,7 @@ describe("onboard dashboard helpers", () => { "", " Or open a sandbox shell first:", " nemoclaw my-dcode connect", - " then run the configured interactive agent command", + " then run: dcode", ].join("\n"), ); expect(output).not.toContain("openclaw tui");