feat(model): add /model picker

This commit is contained in:
Peter Steinberger
2026-01-12 06:02:39 +00:00
parent 121c9bd6f3
commit 2da2057a37
10 changed files with 434 additions and 136 deletions

View File

@@ -48,10 +48,7 @@ export async function promptAuthChoiceGrouped(params: {
const methodSelection = (await params.prompter.select({
message: `${group.label} auth method`,
options: [
...group.options,
{ value: BACK_VALUE, label: "Back" },
],
options: [...group.options, { value: BACK_VALUE, label: "Back" }],
})) as string;
if (methodSelection === BACK_VALUE) {

View File

@@ -85,6 +85,13 @@ describe("applyAuthChoice", () => {
expect(text).toHaveBeenCalledWith(
expect.objectContaining({ message: "Enter MiniMax API key" }),
);
expect(result.config.models?.providers?.minimax).toMatchObject({
baseUrl: "https://api.minimax.io/anthropic",
api: "anthropic-messages",
});
expect(result.config.agents?.defaults?.model).toMatchObject({
primary: "minimax/MiniMax-M2.1",
});
expect(result.config.auth?.profiles?.["minimax:default"]).toMatchObject({
provider: "minimax",
mode: "api_key",

View File

@@ -31,12 +31,12 @@ import type {
ResetScope,
} from "./onboard-types.js";
export function guardCancel<T>(value: T, runtime: RuntimeEnv): T {
export function guardCancel<T>(value: T | symbol, runtime: RuntimeEnv): T {
if (isCancel(value)) {
cancel(stylePromptTitle("Setup cancelled.") ?? "Setup cancelled.");
runtime.exit(0);
}
return value;
return value as T;
}
export function summarizeExistingConfig(config: ClawdbotConfig): string {