mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 03:45:46 -06:00
fix(onboard): reject noninteractive TUI mode (#115573)
This commit is contained in:
committed by
GitHub
parent
710efc9a86
commit
61f3cdfaa2
@@ -885,4 +885,18 @@ describe("setupWizardCommand", () => {
|
||||
expect(mocks.runInteractiveSetup).not.toHaveBeenCalled();
|
||||
expect(mocks.runGuidedOnboarding).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("rejects conflicting TUI and non-interactive modes", async () => {
|
||||
const runtime = makeRuntime();
|
||||
|
||||
await setupWizardCommand({ tui: true, nonInteractive: true, acceptRisk: true }, runtime);
|
||||
|
||||
expect(runtime.error).toHaveBeenCalledWith(
|
||||
"--tui cannot be combined with --non-interactive. Remove --tui for automation, or remove --non-interactive to open the terminal hatch.",
|
||||
);
|
||||
expect(runtime.exit).toHaveBeenCalledWith(1);
|
||||
expect(mocks.runNonInteractiveSetup).not.toHaveBeenCalled();
|
||||
expect(mocks.runInteractiveSetup).not.toHaveBeenCalled();
|
||||
expect(mocks.runGuidedOnboarding).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -473,6 +473,13 @@ export async function setupWizardCommand(
|
||||
runtime.exit(1);
|
||||
return;
|
||||
}
|
||||
if (normalizedOpts.tui && normalizedOpts.nonInteractive) {
|
||||
runtime.error(
|
||||
"--tui cannot be combined with --non-interactive. Remove --tui for automation, or remove --non-interactive to open the terminal hatch.",
|
||||
);
|
||||
runtime.exit(1);
|
||||
return;
|
||||
}
|
||||
if (
|
||||
normalizedOpts.secretInputMode &&
|
||||
normalizedOpts.secretInputMode !== "plaintext" && // pragma: allowlist secret
|
||||
|
||||
Reference in New Issue
Block a user