Onboard: reject tools profile on remote wizard path

This commit is contained in:
Tak Hoffman
2026-03-07 09:22:12 -06:00
parent 5d71a83b72
commit 0c5d9fb195
2 changed files with 39 additions and 0 deletions

View File

@@ -646,6 +646,39 @@ describe("runOnboardingWizard", () => {
);
});
it("fails when interactive mode selection resolves to remote with --tools-profile set", async () => {
const select = vi.fn(async (params: WizardSelectParams<unknown>) => {
if (params.message === "What do you want to set up?") {
return "remote";
}
return "advanced";
}) as unknown as WizardPrompter["select"];
const prompter = buildWizardPrompter({ select });
const runtime = createRuntime({ throwsOnExit: true });
await expect(
runOnboardingWizard(
{
acceptRisk: true,
flow: "advanced",
toolsProfile: "coding",
authChoice: "skip",
installDaemon: false,
skipProviders: true,
skipSkills: true,
skipHealth: true,
skipUi: true,
},
runtime,
prompter,
),
).rejects.toThrow("exit:1");
expect(runtime.error).toHaveBeenCalledWith(
'--tools-profile is only supported when --mode is "local".',
);
});
it("prompts for tool access profile before workspace in local advanced flow", async () => {
const promptOrder: string[] = [];
const select = vi.fn(async (params: WizardSelectParams<unknown>) => {

View File

@@ -407,6 +407,12 @@ export async function runOnboardingWizard(
],
})) as OnboardMode));
if (mode === "remote" && opts.toolsProfile !== undefined) {
runtime.error('--tools-profile is only supported when --mode is "local".');
runtime.exit(1);
return;
}
if (mode === "remote") {
const { promptRemoteGatewayConfig } = await import("../commands/onboard-remote.js");
const { logConfigUpdated } = await import("../config/logging.js");