fix(cli): reject misplaced gateway instance selectors (#6229)

* fix(cli): inherit gateway instance selectors in subcommands

* fix(cli): reject misplaced gateway instance selectors

* test(cli): strip ANSI styling from gateway usage assertions
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-16 01:24:50 +08:00
1 parent 9d2762a4f1
commit 31b193236f
3 files changed
+85 -3

No files matched your search

+6
View File
@@ -151,6 +151,12 @@ def create_gateway_app(
) -> None:
"""Start the nanobot gateway."""
if ctx.invoked_subcommand is not None:
if config is not None or workspace is not None:
ctx.fail(
"--config and --workspace must follow a management subcommand that "
"supports them. See "
f"'nanobot gateway {ctx.invoked_subcommand} --help'."
)
return
if foreground and background:
console.print("[red]Error: --foreground and --background cannot be used together.[/red]")