fix(cli): fast-path bare channels help (#77659)

* fix(cli): fast-path bare channels help

* fix(cli): normalize channels add argv gating

* fix(cli): restore channel add completion flags
This commit is contained in:
Vincent Koc
2026-05-05 16:02:39 -07:00
committed by GitHub
parent 1e1903487f
commit fdddb413ef
16 changed files with 319 additions and 48 deletions

View File

@@ -97,7 +97,9 @@ describe("completion-cli write-state", () => {
expect(await fs.readdir(cacheDir)).toEqual(
expect.arrayContaining(["openclaw.bash", "openclaw.fish", "openclaw.ps1", "openclaw.zsh"]),
);
expect(registerSubCliByNameMock).toHaveBeenCalledWith(program, "qa");
expect(registerSubCliByNameMock).toHaveBeenCalledWith(program, "qa", expect.any(Array), {
purpose: "completion",
});
expect(registerPluginCliCommandsFromValidatedConfigMock).toHaveBeenCalledTimes(1);
expect(stderrWrites).toHaveBeenCalledWith(
expect.stringContaining("skipping subcommand `qa` while building completion cache"),
@@ -126,7 +128,9 @@ describe("completion-cli write-state", () => {
await program.parseAsync(["completion", "--write-state"], { from: "user" });
expect(registerSubCliByNameMock).toHaveBeenCalledWith(program, "qa");
expect(registerSubCliByNameMock).toHaveBeenCalledWith(program, "qa", expect.any(Array), {
purpose: "completion",
});
expect(registerPluginCliCommandsFromValidatedConfigMock).not.toHaveBeenCalled();
expect(await fs.readdir(path.join(stateDir, "completions"))).toEqual(
expect.arrayContaining(["openclaw.bash", "openclaw.fish", "openclaw.ps1", "openclaw.zsh"]),