feat: wizard model picker (#611, thanks @jonasjancarik)
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
### New Features and Changes
|
### New Features and Changes
|
||||||
- Onboarding/Models: add first-class Z.AI (GLM) auth choice (`zai-api-key`) + `--zai-api-key` flag.
|
- Onboarding/Models: add first-class Z.AI (GLM) auth choice (`zai-api-key`) + `--zai-api-key` flag.
|
||||||
- Agents: add human-delay pacing between block replies (modes: off/natural/custom, per-agent configurable). (#446) — thanks @tony-freedomology.
|
- Agents: add human-delay pacing between block replies (modes: off/natural/custom, per-agent configurable). (#446) — thanks @tony-freedomology.
|
||||||
|
- Onboarding/Models: add catalog-backed default model picker to onboarding + configure. (#611) — thanks @jonasjancarik.
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
- Auto-reply: prefer `RawBody` for command/directive parsing (WhatsApp + Discord) and prevent fallback runs from clobbering concurrent session updates. (#643) — thanks @mcinteerj.
|
- Auto-reply: prefer `RawBody` for command/directive parsing (WhatsApp + Discord) and prevent fallback runs from clobbering concurrent session updates. (#643) — thanks @mcinteerj.
|
||||||
|
|||||||
@@ -230,7 +230,20 @@ export async function promptDefaultModel(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const initialValue = allowKeep ? KEEP_VALUE : configuredKey || undefined;
|
let initialValue: string | undefined = allowKeep
|
||||||
|
? KEEP_VALUE
|
||||||
|
: configuredKey || undefined;
|
||||||
|
if (
|
||||||
|
allowKeep &&
|
||||||
|
hasPreferredProvider &&
|
||||||
|
preferredProvider &&
|
||||||
|
resolved.provider !== preferredProvider
|
||||||
|
) {
|
||||||
|
const firstModel = models[0];
|
||||||
|
if (firstModel) {
|
||||||
|
initialValue = modelKey(firstModel.provider, firstModel.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const selection = await params.prompter.select({
|
const selection = await params.prompter.select({
|
||||||
message: params.message ?? "Default model",
|
message: params.message ?? "Default model",
|
||||||
@@ -256,6 +269,12 @@ export function applyPrimaryModel(
|
|||||||
const defaults = cfg.agents?.defaults;
|
const defaults = cfg.agents?.defaults;
|
||||||
const existingModel = defaults?.model;
|
const existingModel = defaults?.model;
|
||||||
const existingModels = defaults?.models;
|
const existingModels = defaults?.models;
|
||||||
|
const fallbacks =
|
||||||
|
typeof existingModel === "object" &&
|
||||||
|
existingModel !== null &&
|
||||||
|
"fallbacks" in existingModel
|
||||||
|
? (existingModel as { fallbacks?: string[] }).fallbacks
|
||||||
|
: undefined;
|
||||||
return {
|
return {
|
||||||
...cfg,
|
...cfg,
|
||||||
agents: {
|
agents: {
|
||||||
@@ -263,13 +282,7 @@ export function applyPrimaryModel(
|
|||||||
defaults: {
|
defaults: {
|
||||||
...defaults,
|
...defaults,
|
||||||
model: {
|
model: {
|
||||||
...(existingModel &&
|
...(fallbacks ? { fallbacks } : undefined),
|
||||||
"fallbacks" in (existingModel as Record<string, unknown>)
|
|
||||||
? {
|
|
||||||
fallbacks: (existingModel as { fallbacks?: string[] })
|
|
||||||
.fallbacks,
|
|
||||||
}
|
|
||||||
: undefined),
|
|
||||||
primary: model,
|
primary: model,
|
||||||
},
|
},
|
||||||
models: {
|
models: {
|
||||||
|
|||||||
Reference in New Issue
Block a user