Skip to content

Commit f078f7e

Browse files
fix(onboard): reject sandbox names that collide with global CLI commands
A sandbox named 'status', 'list', or 'debug' becomes inaccessible because the CLI router matches global commands before sandbox names. Add a reserved-name check in promptValidatedSandboxName that rejects names matching any global command and prompts the user to choose a different name. Closes #1731 Signed-off-by: latenighthackathon <latenighthackathon@users.noreply.github.com>
1 parent 035144e commit f078f7e

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

src/lib/onboard.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2233,7 +2233,20 @@ async function promptValidatedSandboxName() {
22332233
// Validate: RFC 1123 subdomain — lowercase alphanumeric and hyphens,
22342234
// must start with a letter (not a digit) to satisfy Kubernetes naming.
22352235
if (/^[a-z]([a-z0-9-]*[a-z0-9])?$/.test(sandboxName)) {
2236-
return sandboxName;
2236+
// Reject names that collide with global CLI commands.
2237+
// A sandbox named 'status' makes 'nemoclaw status connect' route to
2238+
// the global status command instead of the sandbox.
2239+
const RESERVED_NAMES = new Set([
2240+
"onboard", "list", "deploy", "setup", "setup-spark",
2241+
"start", "stop", "status", "debug", "uninstall",
2242+
"credentials", "help",
2243+
]);
2244+
if (RESERVED_NAMES.has(sandboxName)) {
2245+
console.error(` Reserved name: '${sandboxName}' is a NemoClaw CLI command.`);
2246+
console.error(" Choose a different name to avoid routing conflicts.");
2247+
} else {
2248+
return sandboxName;
2249+
}
22372250
}
22382251

22392252
console.error(` Invalid sandbox name: '${sandboxName}'`);

0 commit comments

Comments
 (0)