mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 05:53:51 +00:00
fix(agents): fall back to agents.defaults.model when agent has no model config (#24210)
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: 0f272b1027
Co-authored-by: bianbiandashen <16240681+bianbiandashen@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
resolveConfiguredModelRef,
|
||||
} from "../agents/model-selection.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { resolveAgentModelPrimaryValue } from "../config/model-input.js";
|
||||
import type { WizardPrompter, WizardSelectOption } from "../wizard/prompts.js";
|
||||
import { formatTokenK } from "./models/shared.js";
|
||||
import { OPENAI_CODEX_DEFAULT_MODEL } from "./openai-codex-model-default.js";
|
||||
@@ -77,11 +78,7 @@ function createProviderAuthChecker(params: {
|
||||
}
|
||||
|
||||
function resolveConfiguredModelRaw(cfg: OpenClawConfig): string {
|
||||
const raw = cfg.agents?.defaults?.model as { primary?: string } | string | undefined;
|
||||
if (typeof raw === "string") {
|
||||
return raw.trim();
|
||||
}
|
||||
return raw?.primary?.trim() ?? "";
|
||||
return resolveAgentModelPrimaryValue(cfg.agents?.defaults?.model) ?? "";
|
||||
}
|
||||
|
||||
function resolveConfiguredModelKeys(cfg: OpenClawConfig): string[] {
|
||||
|
||||
Reference in New Issue
Block a user